Watch & Learn

Debugwar Blog

Step in or Step over, this is a problem ...

GIMP image matting - Mask Method

2023-01-18 @ UTC+0

The blogger usually likes to look at military equipment. Recently, while browsing a wallpaper site, I found a very nice picture of an Su-35. So, I wanted to isolate the fighter jet - a process commonly known as ‘cutout’. Since the blog also needs some illustrations from time to time, it’s necessary to practice the method of cutout. This time, I used the mask method for cutout and made a note. Please don’t laugh, PS masters.

Original Image

First, here is the original image:

The original image is relatively clean, suitable for beginners to practice ; )

Mask layer principle

The principle of the mask layer is like a photo in a picture frame. Because the frame has a mask, what we see is actually the unmasked part, and the masked part is invisible. Therefore, the most important part of using the mask layer for cutout is how to make this mask, and the mask needs to cover what should be covered and leak what should be leaked.

Extract contour

No nonsense, we start making the mask layer now.

Drag the image to be processed into GIMP, and first copy a new layer:

The most important step in cutout is to extract the main outline. Since it’s about extracting the outline, we don’t pay attention to the details. Ideally, the part we need is one color and the part we don’t need is another color.

Adjust color curve

With the newly copied layer activated, select ‘Menu’ -> ‘Curve’ in sequence:

By dragging the curve, adjust the contrast as strongly as possible to lay a good foundation for the next step of extracting the subject to be cut out.

Then, you need to extract the main body of the adjusted image. This can be achieved by going to ‘Color’ -> ‘Component’ -> ‘Extract Component’:

You can try different colors in the component dropdown list, usually there is a color that can achieve the ‘black and white separation’ effect as shown in the picture above. Of course, there might be some noise, for example, there is one in the upper left corner of the picture above, but this is easy to adjust. Use any selection tool to circle it, and then use the paint bucket tool to paint the color as the background color (black). 

Prepare the mask layer

Right-click on the original layer, select ‘Add Layer Mask’, and then select ‘White (completely opaque)’ in the dialog box that pops up and click OK. At this time, a white ‘preview’ layer will appear next to the picture preview of the original layer, which is the mask layer we need.

(The reason for choosing ‘White (completely opaque)’ is that after our processing above, the part of the fighter jet to be cut out is white)

Final processing

Finally, perform the following operations:

  1. Click on the copied layer, use the shortcut keys ctrl+a, ctrl+c to copy the layer
  2. Click on the mask layer that was just added (note that you should click on the white part in the picture above, otherwise the original layer will be selected)
  3. Use ctrl+v to paste the copied layer
  4. Click on the eye icon in front of the copied layer to hide this layer (you can also delete it directly)

You can then see the effect in the ‘frame’, which is the result of the cutout:

If you are satisfied with the cutout effect at this point, you can click on the green anchor icon in the lower right corner to complete the creation of the mask layer. 


In the above text, we obtained the ‘black and white separation’ image by adjusting the color curve. In fact, as long as it is a viable method, everyone should not stick to the methods in this tutorial in actual production.
  • Original Image
  • Mask layer principle
  • Extract contour
  • Adjust color curve
  • Prepare the mask layer
  • Final processing
  • Others
  • CopyRight (c) 2020 - 2025

    Designed by Hacksign