The fade effect

Many screenshots in the HelpSetMaker manual use a "fade" effect on the screenshot. We will create this now in a step-by-step fashion. First, some words about the concepts:

The concepts

For our effect, we need two powerful concepts of GIMP: Layers and layer masks

Layers

GIMP handles pictures not only as bitmaps arrays, but as a stack of "slides", or, to say it with GIMP's words: "layers". Each layer contains a complete picture on its own and the final picture is composed by looking through all layers from the top of the stack. Of course, this does only really make sense if the layers may contain transparent sections (just as slides do...). As we'll see, this is indeed possible.

Layer masks

Another important concept is the layer mask. Each layer can have such a mask, which, in the beginning, is nothing more than a greyscale painting applied to the layer additionally to its original content. The magic is that the grey value of each pixel in the "mask painting" defines the opaqueness of the original layer content. A white pixel in the mask means "totally opaque", a black pixel is for "completely transparent". Shades of grey define any level of semi-opaqueness: The darker, the more transparent.

As you might already have concluded, the layer masks will be the most important tool for our fade effect.

Prestep: Make the picture maskable

Saying every layer in the picture has a mask is a little bit too general. In fact, one layer has not: The "background" layer.

Unfortunately, after loading a PNG file into GIMP, the complete content actually is in the background layer. We have to change this:

  1. Open the "Layers" dialog. As you see, there is only one layer and it is named "background". Click on the "Copy" button in the bottom of the window. A new layer appears, named "Background copy".



    Copy the background layer


  2. Remove the old and superfluous "Background" layer.



    Remove old background layer.


After these two steps, we have the starting point for our mask operation

Creating the fade effect

The central point of the fading effect is to apply a layer mask to the picture and make it "fading" between white and black.

  1. You start by actually adding a layer mask to the picture layer.



    Add a layer mask


    Note that after this operation, you will not be able to work on the actual layer content any more. Every painting operation will affect the mask only, not the content.

  2. GIMP asks how your mask should be initialized: All-opaque, all-transparent or from the alpha channel. We start with an all-opaque mask.



    Layer mask initialization


    Note that even though colors are mentioned here in the dialog, you won't see any of them in the picture. These colors are more or less "virtual" and define the transparence level of the layer mask as described above.

  3. Now that the layer mask is initialized, we can work on it. Currently, all pixels are white and therefore the mask is completely unmasking. We'll change this now.

  4. Select the brush tool from the GIMP's main menu. Do also have a look at the selected brush type. Take the biggest circular one.



    Brush selection


    Take care (any adjust if needed) that the painting color is black!

  5. Have a look at the picture. The fading should take place not too near to the important part, but also not too far away. Think about it, then take your just selected brush tool and paint a nicely rounded curve where you want to have your fading frontier.



    Painting the fade frontier


    As we are in layer mask mode, your painting goes onto the layer mask changing pixels into black. Black means "totally transparent" and therefore the content of the picture completely disappears. Instead, a grey-in-grey-square pattern is shown, which means "nothing".

    If you feel uncomfortable with your just-painted curve, use the "Undo" feature of GIMP and try again. Often, you get the best results if you draw the curve in "one move".

  6. Take the brush to enlarge your mask towards the final content of the picture. I.e. remove the important things and let the unimportant there.



    Enlarge mask with brush


  7. Finishing the mask just with the brush is an unfullfilling task. GIMP has better tools for this. Take the hand-drawn region tool from its main menu.



    Hand drawn region tool


  8. Use the tool to select the complete yet-to-be-fillen area. Press the mouse button at beginning and then surround the complete region without releasing the mouse button. At the left and upper side, drag the mouse over GIMP's own decorations to be sure that you get all of those picture's regions.



    Select the remaining picture parts


  9. Now, switch to the fill tool.



    Fill tool


  10. Place the mouse cursor in the just-selected region and press the left mouse button. The complete region is filled with black and therefore the mask turns into "full transparent" mode.



    Fill the rest of the needed region


  11. Remove the fill selection. This is important as as long as there is a selection, all operations will only cover that selection. Our next steps have to be applied to the whole picture, however.



    Remove fill selection


  12. Now, we have a mask which removes exactly those things from the picture we need and leaves the crappy rest intact. Fortunately, it is very simple to change this by applying the "invert" operation to the layer mask.



    Invert the mask


  13. Inverting brings us a big step forward. We do now have a mask which leaves only those parts of the picture we are interested in. It does not fade, however. This can be changed with a smoothing filter operation. We take the IIR-Gaussian blur filter. It smoothens a picture by taking average values from certain pixels around. The more pixels, the smoother the filter operates. For our fading effect, a number between 30 and 40 is the best.



    screenshot/gaussblur.png


  14. Aha! Now we have that smooth fadeout effect we were so eager for.



    Blur result


Cropping the result

Time for cleanup. First, we crop the picture so it does not contain all that white-to-be stuff which is now masked out.

  1. Select the crop tool from GIMP's main dialog.



    Select crop tool


  2. Now, open a rectangular area with the crop tool. Be sure that the upper right corner really is (0,0). You can adjust this in the dialog, too. Do not crop too near to the fadeout area as it might be that the fadeout effect itself is cropped then, too.



    Cropping the picture


  3. The cropping result is now the picture with the dimensions it will have in the end and the complete fading of the main content.



    Crop results


Removing the transparent portions

The effect work is now finished, but there could raise problems from the current picture state. As indicated by the chessboard pattern, there are transparent regions in the picture now. The PNG format can cope with this, as can do most web browsers, but there might be some having problems or showing wrong results. Therefore, we'll turn these transparent regions into white now.

  1. Turn again to the layer window. Create a new layer and set its initialization color to "white".



    Create white layer


  2. The new layer is created on top of the layer stack. Therefore, the picture turns while completely. Correct this by moving the new layer down.



    Move white layer down


  3. Voila. The picture now features the fadeout exactly as we would like to have it



    Blur to white


Final cleanup

Two final cleanup steps can be done on the picture: Applying the layer mask and merging the layers.

  1. Apply the layer mask for the main content layer. This will make the masking permanent and unchangeable. Before this step, you always can completely revert the masking process and start a new one on the original picture data.



    Apply layer mask


  2. Merge the two remaining layers into one. As PNG cannot store multiple layers, this step would happen anyway on storage of the picture. Doing it now saves you one warning message.



    Merge layers


  3. Merging layers always raises a dialog. Its options do only make a difference if the layers in the picture differ in size and position. As this is not the case, just go for the default setting.



    Merge layer options