It can be disappointing when we have a set of images to use in a web page or mobile app but they have a background colour which leaves an unwanted rectangular border or background, instead of cleanly merging with the page background. GIMP (GNU Image Manipulation Program) can help us with manipulation of these images to allow the transparency needed for the image to merge seamlessly with the page barkground. GIMP is a powerful image editor with capabilities and output quality similar to the popular but expensive Photoshop program.
In this article we will take a JPG image with a white background and convert it into the PNG format with "Alpha" channel transparency. The first section of the article takes us through the process for converting, resizing and exporting an individual image. The second part of the article extends this with use of a great batch process plugin, BIMP, which handles multiple procedures with a batch of images and allows us to save the procedure for future use.
The programs are freely provided by their respective authors and if you find them useful, please check their websites and donate for their continued development.
Adding transparency, resizing, and converting to PNG format with GIMP
- Select image (This example uses a JPG with white background)
- Add Alpha channel from the "Layers / Transparency" menu ( the available channels can be seen in the Layers/channels box)
- Add color to alpha from the "Layers / Transparency" menu (White was selected in this example)
- Resize image to needed size with "scale image " from the "Image" menu
- Convert / Save to PNG with "Export as.." from the "File" menu (either select "PNG" from the extensions box or simply type "png" as the filename extension.
[fslideshow:7 width:600 height:0 delay:10 border:1 align:auto src:disp link:1 title:top Manipulating images for transparency, size an format with GIMP]
Making it easy with BIMP
- Install BIMP plugin if not present
- Open Batch procedures menu
- Add images (or folder)
- Add first procedure (use "Change Format and Compression" - to convert to PNG in this example)
- Add second procedure ("Resize" image in this example)
- Add third procedure (use "Other GIMP procedures" and search for "alpha" - select "ColortoAlpha" )
- Select output folder
- Run (Apply) the batch procedure
- Save the batch procedure for future use
[fslideshow:8 width:600 height:0 delay:10 border:1 align:auto src:disp link:1 title:top GIMP batch process using the BIMP plugin]
[tag image gimp bimp]