How to Make a Semi-Transparent Image Using GIMP

GIMPSee also: All About GIMP – A Simple User Guide.

Took me ages to work this out so I hope it comes in handy for you.

If you’ve ever used GIMP then you will know that it’s not the most intuitive graphics editor to learn to use. To prove that point, I frequently open images in Kolourpaint (the Linux equivalent to Window’s Paint) to make minor edits then re-open them in GIMP to do the bits I can’t do in Kolourpaint and vice-verse. I know GIMP is a powerful graphics editor I just wish it were more intuitive. Anyway…

Two things I recently learned to do with GIMP:

  1. Convert every occurrence of a particular colour into a transparent region (good for web graphics), and
  2. Make an image semi transparent so that it may be used as a watermark.

Here’s how to do those tasks.

Make a Colour Transparent

You can make any background colour or any colour within an item transparent. Here’s the method:

  • open the image you want to edit with GIMP (right-click it, select Open With… then choose GIMP),
  • right-click the image then move your cursor to Colours and select Colour to Alpha,
  • in the pop-up box you will see a preview of your image with a (usually) white rectangular bar displayed below it (as outlined in red in image 1). Left-click that bar and a Colour to Alpha Colour Picker dialogue box will pop-up (image 2). In this new box there is another coloured bar (highlighted in red in Image 2). To the right of that bar is an image of a dropper. Left-click the dropper then left-click the color on your image that you’d like to make transparent. Once done, click OK twice,
  • that’s it, anything of your chosen colour will now be transparent.
  • Either save the image as a PNG file else merge the layers then save it as a GIF or JPEG. To merge the layers, right-click the image, move your cursor to Image then select Merge Visible Layers.

GIMP-Choose-Transparency-Colour

Image 1: the highlighted box contains the colour that is to be made transparent.

GIMP-Choose-Transparency-Colour2

Image 2: the highlighted box contains the colour value that is to be made transparent.

popeye-and-olive-oyl jpg

Image 3: The image with a background I wished to make transparent.

popeye-and-olive-oyl

Image 4: The almost finished product.

If you look closely you will see that the image with the transparent background still has some blue sky showing at its top. Had I wanted to remove that then I could either re-apply the above method but choosing that particular shade of blue to make transparent or I could have rubbed it out using the eraser with an opacity setting chosen.

Make a Complete Image Semi-Transparent

Here’s a picture that I could use as a background image on a web-page:

Polar bear sticking out his blue tongue

Polar bear sticking out his blue tongue

I would need to make it a little more watermark like before I could use it as a background image otherwise it could make it hard to discern any text on the page. To turn the image into a “watermark” I’d need to make it partially transparent by altering the image’s opacitysetting in GIMP. Here’s how to do that:

  • open the image with GIMP,
  • use the top menu bar to browse the Windows menu and move your cursor downwards to Dockable Dialogues then select Layers. Alternatively, press Ctrl+L,
  • the Layers dialogue box has an Opacity slider control. Ensure your image is highlighted then move the slider to your desired opacity level (50% is generally good enough),
  • next we flatten the image by right-clicking over the image, moving the cursor to Image then selecting Flatten Image. We do this to ensure that the opacity is preserved when we save the image as a jpeg, gif or png etc.
  • Voila! Save the image.
Watermark: Polar Bear Sticking Out His Tongue

Watermark: Polar Bear Sticking Out His Tongue

Extra Tips

Interlaced images contain more data than their non-interlaced counterparts so use non-interlaced files when you want an image to take up less room.

PNG Files are lossless which means they do not suffer image degradation during edits so convert your images to png format should you be editing and saving them multiple times. JPEG files are smaler than PNG’s so convert them to jpeg once you’ve finished editing them if you want them to take-up less storage space. Sometimes PNG files are smaller than GIF files, other times they’re larger – it varies from file to file.

Transparency and opacity are not the same properties. Opacity is the property of being variably see-through and usually has an associated back-drop colour (in the above watermark that back-drop colour is white). Transparency is the property of being entirely see-through and without any associated back-drop colour. Images with transparent regions will not hide (occlude) any image they overlay where those transparent images are present. Images with opacity hide (occlude) any images over which they are displayed.

Not all image formats are capable of preserving image transparency data. PNG does preserve it but IE6 and 7 do not properly render (display) transparency in PNG images; GIF preserves image transparency data and it is properly rendered by all browsers; JPEG doesn’t preserve image transparency at all.

Flattening and Merging Layers are not the same actions. When you flatten an image, you convert all the layers that make up that image into one layer. When you merge the layers, you only merge the visible layers not the invisible layers. Images that have been flattened lose any transparency they may have had. Images that have had their visible layers merged retain any transparency they may have.

Comments

  1. says

    Thanks – a very useful guide. I found the explanations in the tips particularly helpful; I feel as if I’ve learnt something more than just “how to…”. I’ve Stumbled this page.

  2. Contact Patricia says

    After surfing for hours on the internet, this is the first, the easiest and most helpfull post!!!
    Thanks a lot!

  3. Contact Patricia says

    After surfing for hours on the internet, this is the first, the easiest and most helpfull post!!!
    Thanks a lot!

  4. 100steps says

    Thank you!  Thank you!  THANK YOU!!  This was just what I was looking for, and all the other online “answers” on how to do it did not include the Flatten part, which is key to the whole thing.  Much appreciated!

  5. Yaniv says

    Thanks, Word doesnt let you play with the watermark’s transparency (2007 Word) and this has been very helpful

  6. Wayne Butt, Canada says

    Thanks very much. Saved me a ton of ‘can’t figure this out’ and now I have – thanks to you – the correct opacity watermark on my images (www.thephotojournal.info/gallery/). I’ll visit your site again! And, thanks again !!! :D

  7. Naomi says

    This post did help me figure out how to make a picture transparent, but I need to take it one step futher. I need a picture to have what you might call a gradiant transparency. I want the picture completely transparent in the center and be graded out to be fully opaque at the edges. Any tips? (reply by email if possible)

  8. Derek says

    I followed this tutorial to create a semi-opaque png. However, using “Flatten Image” to create a single layer did not work for me. Using “Merge Layers” did the trick though. Thank you, the tutorial was most helpful.

Leave a Reply