GT Portal . Forums . Official Tutorials . Art Galleries . FAQs . Search . New Posts . Contact Us Login  .  Register


GimpTalk Announcement :
Try your digital-art skills against your fellow gimpers in GIMPtalk's Biweekly Art competition !


Board index » GIMP News and Help forums » GIMP Tutorials and Tips Make Money Online . Free Image Hosting Script . Convert FLV to Cell Phone Format
Featured Tutorial : Learn how to create characters by Griatch
Search for :  


Post new topic Reply to topic   [ 15 posts ]  


Author Message
 Post subject:
PostPosted: Wed Nov 30, 2005 5:29 pm 
Online
User avatar

Joined:
Mon Aug 22, 2005 8:35 pm

Topics: 78
Posts: 3813

Find User's Topics

OVERVIEW OF THE GIMP-GAP

This "tutorial" was written in response to discussions that took place in another thread. It is not a true tutorial because it does not particularly instruct on how to accomplish a specific task or create any graphic as a result; it merely covers some of the basic operations of the GIMP-GAP.

----
The GAP is more than just a plug-in, it an entire collection of plug-ins whose main purpose is to keep track of a group of files and allow you to be able to switch between them. It also allows manipulations of the files (which are called "frames") by applying the same filter on these frames, one at a time without the user having to do it manually.

Let us assume that you have captured some images from your camera and they are on your hard drive as the files "Capture_0001.jpg", "Capture_0002.jpg", "Capture_0003.jpg", "Capture_0004.jpg", "Capture_0005.jpg", and "Capture_0006.jpg". To start editing this sequence of frames in the GIMP-GAP, open up the first file just like you would any other file. The GIMP itself makes no distinction between this "video frame" and any other image; but the GAP commands do. When you perform a "Video->Goto->Last frame", for example, the GAP looks on the hard drive for the last file that meets the filename template of "Capture_####.jpg" and closes the current file and opens that one (although it does it in the same edit windows). At any point in time, you are still just editing an image like any "normal" image.

The first thing to do is to convert all these frames to .XCF files. While you can use the GAP to edit JPGs, PNGs, and GIFs, you basically turn it into a "flipbook" and cripple its functionality. Trust me, you will want to use XCFs.

Perform "Video->Frames convert" and change the extension to XCF. It is a good idea to make sure that the Image Mode is set to RGB (many filters and GAP functions do not work with Indexed images). You can change the name and location of the file as well using the Basename's "..." button. Also, note the "From frame" and "To frame" entries which allow you to save just portions of your sequence. This "conversion" actually loads each frame from disk, converts it, and saves it back to disk (for each and every frame in the specified range). "Video->Frames convert" doesn't really care if no conversion takes place, so you can also use it to save a backup copy of all you frames. This "backing up" ("backupping"?) is often useful because most GAP operations can not be UNDOne.

Once all the frames are copied to disk (it is a copy operation, your JPGs are still there), a window opens with the first frame of the new sequence ("Capture_0001.xcf"). You can close "Capture_0001.jpg" and forget about it; it is no longer needed for anything (unless you find you want to start over).

It is at this point that I usually go through (using the VCR Navigator) and delete or re-arrange any frames that need it (perhaps you have a bad camera shot that has your hand in front of the lens). Navigate to the frame that needs deleting (for example, "Capture_0004.xcf") and perform a "Video->Frames delete". This command deletes from the current frame to the last frame specified by the slider (there is no way to specify the "starting frame" other than navigating to it and making it the current frame). If you are deleting just the current frame then "Capture_0004.xcf" will be deleted and the remaining frames will be renumbered. This means that the files on the hard drive "Capture_0005.xcf" and "Capture_0006.xcf" will actually be renamed to "Capture_0004.xcf" and "Capture_0005.xcf" respectively. I usually write down which frames I delete for possible later reference. You could have performed this step on your JPG files if you were confident that you will not be needing them; there is no UNDO for deleting frames, as you can see, the files are actually deleted from the hard drive.

My next step is to duplicate the layer (once again, for each and every frame). This duplicate layer will serve as a "working copy" and allow me to restore a part (or all) of the original image if it is accidently removed (or perhaps intentionally while performing a filtering function).

Duplicating layers is performed by using the "Video->Frames modify" command. This command is extremely powerful; it is used whenever you wish to repeat an operation for each and every frame (or a subset thereof). You will find that 90% of what you do will be using the Frames Modify command; it is worthwhile to learn it in depth. Here is a screen shot of this splendid command:

Image

Here is a breakdown of the individual parameters that you can specify:

[*] 1 - Frame Range: The range of frames on which to perform the function. By default, this starts out as all the frames from the first to the last. This setting allows you to just perform your operation on a portion of your "video".
[*] 2 - Layer Pattern: A string pattern that can be used to specify the particular layers on which to perform the function. Many times you just want to perform your operation on one layer, but sometimes you will want to do it on multiple layers. (A specific case would be when "merging" layers, combining them into one composite layer). The entries here can be layer numbers, layer names, or just part of a layer name. Layer numbers range from "0" to one less than the number of layers in the frame; "0" is always the top-most layer, "1" is the layer underneath, et cetera.
[*] 3 - Layer Selection: Specifies on which layers to perform the function. It may or may not make use of the "Layer Pattern" described in the previous paragraph (for example, "All Visible" ignores the pattern and operates on any layer which has the "eyeball" set. The "Invert Layer Selection" can be used to choose the unspecified layers (for example, all the "hidden" layers).
[*] 4 - Function Parameter: This allows you to add any text that a particular function might need. It is usually "grayed out" and is currently only used for layer names when duplicating layers (as shown in the screen shot) or when renaming layers. For our example, I have typed in the string "Work" so that the new layers will be named "Work".
[*] 5 - Function: Specifies what particular function you wish to perform. For our example, we wish to Duplicate Layer(s).

Once you have all of your parameters specified, you can click on the "OK" button. (The first time I used the Frames Modify function, I spent about an hour trying to get it to work because after I selected the Function, nothing happened. I must have opened and closed the Frames Modify dialog twenty times and thought for sure that the program was broken. To this day, I sometimes sit back after choosing my Function before realizing that I still have to click "OK".)

After you have a duplicate layer on each of your frames, you will notice that both layers are visible. We only need one layer (or "Work" layer) so let us use the Frames Modify command to make the "Background" layer hidden. Open the Frames Modify dialog, the Frame Range (#1) should already be set so that ALL frames are processed. Change the Layer Pattern (#2) from "0" (the topmost layer) to "1" (the layer underneath, which is the "Background" layer). Leave the Layer Selection (#3) set at "Pattern is a list of layerstack numbers". For the Function (#5) choose "Layer Attributes->Set Layer(s) to invisible". Click OK and the Background layer for all of your frames will become invisible.

----
Well, that was a WHOLE lot of effort expended and we still haven't gotten very far; but fear not, you now know about 90% of what you need about using the GAP. Take a minute to absorb all of it and consider that just about anything you are able to do with a single image in the GIMP, you will be able to repeat for any number of images with very little additional effort. Have some comfort cake to celebrate and ponder this fact and then we can continue in my next post.


_________________
this is bizarre ... it's crazy ... it's stupid ... how can this ... oh my God! It's brilliant!


Top
 Profile  
 
 Post subject:
PostPosted: Wed Nov 30, 2005 5:30 pm 
Online
User avatar

Joined:
Mon Aug 22, 2005 8:35 pm

Topics: 78
Posts: 3813

Find User's Topics
Well, some of you are probably wondering about my saying that the GAP can do "just about anything" the GIMP can do. You may also have notice that one of the Functions (Parameter #5 of the screenshot in the preceding post) of the Frames Modify command is "Apply filter on layer(s)". This means that all of the filters that are available in the GIMP can be executed by the Frames Modify command ("all of the filters" may not be precisely true, but for now it is close enough). There are some things that you can do in the GIMP that are not filters and have not yet been implemented in the GAP.

For example, I have not found a way to set the "Layer Mode" using the GAP. I have had to "hack" the source code to add that function. Now my Layer Attributes Function (which was used in the preceding post) shows up as follows, allowing me to do that: (Addendum: this functionality has been added to GAP Version 2.2.1)

Image


But let's not worry too much about what the GAP can't do; there is enough that it can do to keep us happy for quite a while.

Before we tackle the all-powerful "Apply filter on layer(s)" Function, I want to cover one other topic: selection. Every frame in your sequence can have a different region selected and when you Navigate to another frame, the selection for that new frame will be activated (assuming that you did the wise thing and are working with XCF files). It is also helpful to realize that having nothing selected is the same as having selected ALL (again, with some exceptions that aren't worth noting).

The basic Frames Modify functions of "Selection->Selection all", "Selection->Selection none", and "Selection->Selection invert" are pretty intuitive and I will leave it to you to determine how to use the "Selection to channel" and "Selection from channel" functions. The other selection operations which involve "(source is active frame)" are worth commenting on. Just like editing a single frame in the GIMP, you can limit the region on which a filter acts by defining a selection. With the GAP, this selection can be made on one frame and then copied across an entire range of frames. I will leave the execution of this operation as an exercise but will point out that if the "source" frame falls within the range of the "destination" frames then some undesirable things happen (Addendum: this problem has been fixed in GAP Version 2.2.1 so that the source frame can fall within the destination range. Users of GAP version 2.2.0 still need to avoid this situation). For example, to copy the selection from the first frame to all of the others, set the Frame Range (parameter #1 in the Frames Modify screenshot) as From frame #2 to the last frame.

OK, enough of the basics; it's time to dive into the deep end.

Most everyone is probably familiar with "chroma-keying". It is the technique where a certain color (usually green or blue) is removed from an image and replaced with an entirely different image. This was originally called blue-screening and the color blue was chosen because Kodak (in the 1930s) developed a film that was not sensitive to blue light; when developed the blue parts of the picture would be clear. This allowed for the film to be combined with another strip of film, effectively showing the subject in front of the substitute background.

Later on, the color blue was replaced with the color green because there is very little green in natural human skin tone. This technique (of "green-screening") is commonly used by TV weatherman who stand in front of a giant green wall which is replaced with a weathermap before you see it.

The GIMP-GAP has a function called "BlueBox" that will perform this "blue-screen"/"green-screen"/"chroma-key" for you; it can be found on the "Video" menu. (It is somewhat odd that it is on the Video menu because it only operates on the current frame. I would not be surprised if it is moved to the Filters menu in future revision.) The BlueBox tool will remove specified colors from your image, replacing them with transparency so that the layer underneath is revealed.

I won't go into great detail on how to use the BlueBox filter, but merely mention that the "Keycolor" is the color that is to be removed (it becomes transparent) and that the other parameters allow you to specify how much of the image gets removed. The "Preview" will open up a new window which will display the effects of your current settings. (It should also be mentioned that the "Tools->Color Picker", AKA eye-dropper, is very handy for selecting the Keycolor.)

Usually you will find that you can't remove all of the background that you wish in one shot (not without removing some of the foreground). Due to shadows on the Keycolor background, it is often necessary to execute BlueBox multiple times, using the eyedropper to pick a different Keycolor each time (don't bother doing this now).

Once you are done playing around with the different settings, click on "Cancel"; we aren't even going to use the "Video->BlueBox" command :-b .

Before you get too ticked off at me for wasting your time, open up the ubiquitous Frames Modify command and select the "Apply filter on layer(s)" Function. All of the default settings should be fine for our purposes (and you should, by now, understand how to change them if necessary) so click on "OK".

You should now see a dialog box entitled "Select Filter For Animated Apply on Frames" and partway down the list of filters you will see "plug-in-bluebox".

Image

For those familiar with the Script-fu database browser, you will notice that this dialog is quite similar; the differences being the bottom row of buttons.

The "Apply Constant" button means that whatever settings for the filter (you haven't set these yet, you will be allowed to do that after clicking this button) that you use for the first frame get used for ALL the frames.

The "Apply Varying" means that you will allowed to choose settings for the first frame and then be prompted for the settings of the filter on the last frame. The filter will be applied to each frame in the range with the settings varying incrementally from the first to the last.

For the BlueBox plug-in, we want to use "Apply Constant". Once you click on this you will be presented with the BlueBox dialog that you were playing with earlier. In fact, the same settings that you had when you pressed "Cancel" are still there. This is a very handy feature of all of the GIMP's filter, the retention of previous values, and is especially handy when using the Frames Modify command.

At this point, you just have to get your settings right (you are provided with a Preview window) and click "OK". Each and every one of the frames in your Range will have the Keycolor removed. I will again state that usually you have to execute FramesModify->BlueBox multiple times, slightly modifying the thresholds and Keycolor.

Once the background is removed from all the frames to your satisfaction, the next step will be to put in the background underneath. This will require the second handiest tool in the GAP's arsenal, "Move Path".

For now, I will now leave you to experiment with the above commands and suggest that you also try using the Frames Modify with various filters.

_________________
this is bizarre ... it's crazy ... it's stupid ... how can this ... oh my God! It's brilliant!


Top
 Profile  
 
 Post subject:
PostPosted: Thu Dec 01, 2005 10:50 pm 
Online
User avatar

Joined:
Mon Aug 22, 2005 8:35 pm

Topics: 78
Posts: 3813

Find User's Topics
I was asked to describe how you use the GAP to delete a selected region from each of a range of frames (i.e., select a region, copy the selection to all frames, and perform an "Edit->Clear" for all frames). This is one of those "non-filter" functions which is not provided directly in the GAP. There is a way to do it, however, using layer masks (if anyone knows of an easier way, please share).

Open up the first file of your frame sequence (continuing with the previous example, this would be "Capture_0001.xcf") and select the region that you wish to remove using any of the selection tools (you can also do any feathering or 'grayscale' masking you wish in generating your selection).

Use the Frames Modify command to copy this selection to each of the remaining frames (remember to make sure that your first frame isn't part of the destination range).

Use the Frames Modify command to add an Alpha Channel to your layer (I usually add it to all the layers while I'm at it). We can not add a layermask to a layer unless the layer has an alpha channel.

In the GIMP, when we add a layermask from the selection, we can specify that we want to use the inverse of the selection to create the mask. Unfortunately, this is another of those things that was "left out" of the GAP. Not to worry, though, all we have to do is use the "Video->Frames Modify->Selection->Selection Invert" command to invert the selection before we make the mask.

Once you have inverted the selection for your frames, perform a "Frames Modify->Layer Mask->Add layer mask from selection" to mask out the desired region.

All that is left is to use the Frames Modify command to apply the the layer mask.


NOTE: this method only works to make the selected region transparent. Filling it with a color is left as an excercise for the reader (or until I find time to write another post).

_________________
this is bizarre ... it's crazy ... it's stupid ... how can this ... oh my God! It's brilliant!


Top
 Profile  
 
 Post subject:
PostPosted: Wed Dec 14, 2005 10:52 am 
Offline

Joined:
Sun Dec 11, 2005 8:52 pm

Topics: 0
Posts: 1

Find User's Topics
Hi,

I'm just reading your GAP overview. It's GREAT !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
I'm new to GAP and that's what I've been looking for. It's very clearly explained and even with my poor english I can understand it.
I just started to read it and been very gratefull. Congratulations and thank you.

Best greetings from Poland
Murek

ps. In your second post you've written"You may also have notice that one of the Functions (Parameter #1 of the screenshot in the preceding post) of the Frames Modify command is "Apply filter on layer(s)" - probably should be Parameter #5


Top
 Profile  
 
 Post subject:
PostPosted: Thu Mar 23, 2006 5:27 pm 
Offline

Joined:
Thu Nov 24, 2005 6:52 pm

Topics: 8
Posts: 49

Find User's Topics
Thanks for the tut very much appreciated! :w:


Top
 Profile  
 
 Post subject:
PostPosted: Thu Mar 23, 2006 6:51 pm 
Online
User avatar

Joined:
Mon Aug 22, 2005 8:35 pm

Topics: 78
Posts: 3813

Find User's Topics
Thanks for your kind words.

Some may be interested that the ability to set the layer Mode (which I previously stated was missing) has been added to the version 2.2.1 of the GAP and will be present in the next stable release. It appears in the Frames Modify dialog as shown below.

Image

Wolfgang Hofer, the maintainer of the GAP, has also added (to the current CVS) the ability to invert an existing layer mask (in the same function menu). In addition, he has added the amazing capability to "Apply Filter on Layer Masks" which, among other things, should be very handy for non-destructively smoothing the edges of "renders" in an animation.

_________________
this is bizarre ... it's crazy ... it's stupid ... how can this ... oh my God! It's brilliant!


Top
 Profile  
 
 Post subject:
PostPosted: Sun Aug 06, 2006 8:27 am 
Offline
User avatar

Joined:
Mon Jun 13, 2005 11:15 am

Topics: 583
Posts: 7097

Find User's Topics
Quote:
at is at this point that I usually go through (using the VCR Navigator) and delete or re-arrange any frames that need

I 'm going trought the first steps but im stuck with the VCR Navigator
how to use the VCR navigator?

just now i open the folder with the frames and i open the xxxx000001.xcf ,Now how i can rearrange the frames?

and, on the top of VPN interface ...what is the function on OFF, NAME,and POS checkbox ?

There is a way to select all the frames , or for multiple selection i must ctrl-click one by one the frames i want select?

_________________
Image

http://www.flickr.com/photos/97844002@N00/


Top
 Profile  
 
 Post subject:
PostPosted: Sun Aug 06, 2006 9:24 am 
Online
User avatar

Joined:
Mon Aug 22, 2005 8:35 pm

Topics: 78
Posts: 3813

Find User's Topics
Quote:
and, on the top of VPN interface ...what is the function on OFF, NAME,and POS checkbox ?


That line holds the "Active Layer Tracking" options. It simply allows you to have the active layer automatically set when you change frames; if you have it set to NAME and you choose the "Background" layer then when you go to a different frame, it will make the layer named "Background" the active layer. If the option is OFF then the top layer is active. If set to POS then it chooses the same layer in the layerstack.

Quote:
There is a way to select all the frames , or for multiple selection i must ctrl-click one by one the frames i want select?


I think most of your questions about this will be answered by clicking on the right-mouse button. The interface is basically like any file manager dialog: you can select a sequence of frames by selecting a frame and holding down the SHIFT key as you click on a second frame; you can use CTRL to toggle the selection of individual frames; and you can CUT, COPY, and PASTE the selected frames. CUTs and COPYs will copy the frames to a temporary directory on disk (this can use up a lot of disk space for large selections; the "clear video buffer" command will erase those temporary files).

_________________
this is bizarre ... it's crazy ... it's stupid ... how can this ... oh my God! It's brilliant!


Top
 Profile  
 
 Post subject:
PostPosted: Thu Aug 10, 2006 7:07 pm 
Offline

Joined:
Tue Jun 13, 2006 3:28 am

Topics: 0
Posts: 42

Find User's Topics
Great overview, but I have to ask something that'll probably come off as stupid.

How do you get the GAP to work?! I've extracted all the files and moved them to GIMP's Plug-Ins folder, but nothing seems to be different. Any help?

_________________
Image


Top
 Profile E-mail  
 
 Post subject:
PostPosted: Thu Aug 10, 2006 7:37 pm 
Online
User avatar

Joined:
Mon Aug 22, 2005 8:35 pm

Topics: 78
Posts: 3813

Find User's Topics
If you are using Windows then you will have to run the installer program for the GAP (after installing the GIMP). There is a tutorial for downloading and installing the GAP here.

If you are using Linux, how you install it will be dependent upon which distribution you are using.


After you install the GAP, there should be a new menu called "Video" next to the Script-fu menu.

_________________
this is bizarre ... it's crazy ... it's stupid ... how can this ... oh my God! It's brilliant!


Top
 Profile  
 
 Post subject:
PostPosted: Thu Aug 10, 2006 7:42 pm 
Offline

Joined:
Tue Jun 13, 2006 3:28 am

Topics: 0
Posts: 42

Find User's Topics
Thanks very much. :l:

Alright, I got it installed, and now I can understand your instructions. Thanks!

_________________
Image


Top
 Profile E-mail  
 
 Post subject:
PostPosted: Sat Aug 19, 2006 11:33 pm 
Offline
User avatar

Joined:
Mon Jun 13, 2005 11:15 am

Topics: 583
Posts: 7097

Find User's Topics
Now is the second week from the moment i start to try your tut.
It's seem so cristal clear...till i don't open GAP to try it !

Then i drown myself in some glass of water ! ..But i'm getting close !

But Saulgoode if i will meet with success i hope in a nice present from you:

I WANT THIS !!!
:o:

Image

Now i am not even able to handle the basic Gap features , for sure i don't want any extra...but Saulgoode soon i will ask for it

Any way to bribe you ? Ask me everything but give me that stuff !!

_________________
Image

http://www.flickr.com/photos/97844002@N00/


Top
 Profile  
 
 Post subject:
PostPosted: Sat Aug 19, 2006 11:47 pm 
Offline
User avatar

Joined:
Mon Jun 13, 2005 11:15 am

Topics: 583
Posts: 7097

Find User's Topics
And if works only in Linux don't worry...on my laptop Ubuntu ,Gimp 2.3.10 and GAP are ready for it !!

_________________
Image

http://www.flickr.com/photos/97844002@N00/


Top
 Profile  
 
 Post subject:
PostPosted: Sun Aug 20, 2006 12:14 am 
Online
User avatar

Joined:
Mon Aug 22, 2005 8:35 pm

Topics: 78
Posts: 3813

Find User's Topics
You should contact one of the packagers for Ubuntu (I think one of them is "Jimmy Jazz") and ask if he would create a package for GAP 2.2.1version. You might even want to see if the Windows packager (I think that is mainly Tors Lillqvist) would do the same for that platform. Version 2.2.1 is the latest stable version and not a development release; it just takes time for people to get around to compiling binaries.

_________________
this is bizarre ... it's crazy ... it's stupid ... how can this ... oh my God! It's brilliant!


Top
 Profile  
 
 Post subject:
PostPosted: Sun Aug 20, 2006 12:31 am 
Offline
User avatar

Joined:
Mon Jun 13, 2005 11:15 am

Topics: 583
Posts: 7097

Find User's Topics
And this

Quote:
Now my Layer Attributes Function (which was used in the preceding post) shows up as follows, allowing me to do that:

Image

is already in GAP 2.2.1 ?

_________________
Image

http://www.flickr.com/photos/97844002@N00/


Top
 Profile  
 
Display posts from previous:  Sort by  

Post new topic Reply to topic
 [ 15 posts ] 



Who is online

Users browsing this forum: Mz.Teri and 16 guests


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Jump to:  
Related Website
Gimp tutorials database
All rights reserved © GimpTalk 2008
forum software by
phpBB