Transparency with The Gimp
From time to time I will be adding items to these pages giving details of how to achieve certain objectives, usually related to genealogy and the use of Legacy software, often in conjunction with other software.
I am not suggesting that the solutions offered are the only, or indeed the best, options to solving problems but simply that they are ways which I have found to work.
* 'V' indicates a video is available
- Using Legacy Search V
- Search Events, Locations and Married Names V
- Create an Ancestry Book
- Map with Google Earth
- History of British Prime Ministers - Timeline
- British Civil Registration
- The Murder of Adam Mather
- Improve Photo Colour Balance
- Transparency with The Gimp
- Masking with The Gimp
- Web Safe Colours
- Create Legacy Web Pages - Part 1
- Create Legacy Web Pages - Part 2
- Create Legacy Web Pages - Part 3
- Using LTools Tidy Legacy HTML
- Insert Pictures into Web Pages
- Insert RSS Feed into Web Pages
- Getting Online
- Protect Your PC
- Open Legacy files with Open Office V
- FamGenContacts Database
- Create Direct Line Ancestor Tree
The icons below are links to any other software mentioned.
Add Transparency with The GIMP
Quite often I find that I do not have a picture of an individual suitable for use in my website but do have one where the person is part of a group. Furthermore I also feel some pictures are better presented as an ellipse rather than a rectangle. The following is a description of how to select an elliptical portion of a photograph, adjust its size and add transparency with The Gimp, using a photograph of my parent's wedding as the starting point.
Screen shot GIMP1 shows the part of the photo and The Gimp's interface. By selecting the ellipse (top row second left from the menu) an ellipse can be drawn around the portion required.
In actual fact the ellipse is not a dotted line as such but a line of "Marching Ants". Now click Edit>Copy, followed by File>New. A dialogue opens asking to confirm the page size; click "OK" and a new window will open; simply click Edit>Paste and the elliptical section will appear. To anchor the layer go to Layer>Anchor.
Naturally, the picture will not be the size required! To correct this use Layer>Scale Layer to the width or height required. If the picture was too large then it will be surrounded by a chequer board pattern (this indicates transparency) or otherwise it will be bigger than the window. No matter; in the case of the former first use the ellipse tool again to outline the center portion and then, in both cases, Edit>Copy, File>New, Edit>Paste, then Layer>Anchor. Image GIMP2 shows the result.
All that remains now is to add the transparency as the white background looks unsightly, but to do this I will be using the soldier at the top of this page in order to illustrate another point. It is, of course, possible to just change the background colour but if the image is to be used in pages with different coloured backgrounds then transparency is the way to go by using just the one image.
Looking closely at the picture of the soldier it can be seen that there is a flash of white on his helmet. As I intend to select the portion to be made transparent, by colour (in this case the white background) the helmet flash will also be selected (see Image GIMP3). This I don't want.
To overcome this, copy a section of the picture which excludes the background but includes the white flash. In this case I again used the elliptical tool to select but as it was rather fiddly, View>Zoom>x4 was used to make life easier. This selection was then copied to the clipboard.
Image GIMP4 shows the selection made. To make this image the copy was pasted into a new window but this is not needed.
Firstly it is necessary to add an Alpha Channel to the picture. Use Layer>Transparency>Add Alpha Channel. Check on the Main Menu the the boxes under "Select by Colour" are unchecked, then Select>By Colour and left click the white background and the "marching ants" will be seen around all the white portions. Finally Edit>Clear will create the transparency and the chequerboard pattern will be seen (Image GIMP 5). To fix: Layer>Anchor.
Note that, in some circumstances, when selecting by colour it may be necessary to change the threshold (on the Menu) and I have found that a setting of 5.8 is most useful for the work which I do.
All that remains now is to put the white flash back. Just paste and move to position. If it cannot be moved then click the selection rectangle and then the pasted piece and move. Click outside the position to anchor.
Save as a ".gif" or as ".png". I prefer the former as some browsers still may have problems with the ".png" format. I also Interlace the picture when saving.Printer friendly version
Corrections, comments and suggestions are welcome, so please use the contact facility below.
The above information is given without warranty either expressed or implied