|
Background Transparency in Images
Of these, only .gif files support background transparency.
The upper right overlapping square shows the selected foreground color (red) and the lower right square shows the selected background color (white). In this case the selected background color is white, not the yellow image background area in our picture of the red dress. This is where people mostly run into trouble.
Let's work through a specific example with a simple grahic file.
You might say the white area is the background. From the human perspective, looking at this image, that would be a fair thing to say. From a graphic program perspective, however, the background color is not necessarily the picture background. A background color can be any one of the picture's colors designated in the program. There are different means of selecting which color will be designated in each different graphics program but the principle is always the same.
Here the foreground color is shown as red. This is the current color you would be working with, for drawing, filling, etc. The background color is white. So, if we saved our "FREE" graphic, above, with white chosen as the background color and set the option to "Set the Tranparency Value to the Background Color" then we should get what is expected:
Shown without the border it would look like this:
Which is exactly what we want -- the background of the graphic is transparent and the background of this section of the web page shows through.
with yellow as the program background color, then what we get is this:
The part that was yellow is now transparent and probably this is not what we desired. You have to select the right color to be the program background, no matter where it is located in the image. What the program sets as transparent is the color you have selected as the program background color at the time you save the file, not what you consider to be the color of the picture's "background" area.
As you can see, it has three areas of color: red, green and blue. These colors are stored in numeric form in the graphic file and can be displayed or represented in your graphic program in any of several ways. Here is how Paint Shop Pro v3.12 does it:
As you can see, there are three colors, each in its own box or cell. Different .gif format files can have 2, 16 or 256 colors. Not all colors need to be assigned. Unused colors show up as white cells. This graphic only uses three of 16 possible colors.
The red portion of the image is transparent and the background of the page shows through. Now, let's add another color designation to this graphic:
Notice that I added another "red" to the image's colors. It is very similar to the red to its left. Your eye may actually show these to be the same shade of red, but in fact they are actually different shades. It can be hard to understand, but a .gif file can have many shades of the same color. Even though we have added another color to the image's color palette the graphic still looks the same, because the extra shade of red is not used in the actual graphic. It is availab eot be used, it's just not there. Here is the image shown with no transparency:
But now, let's make half of the blue area at the bottom red using the second red color. It will look like this:
Remember, there are two different reds in use here. Even though the two red parts of the graphic look like all one color, it is actually two different shades of red, distinct colors from two different color cells stored in the image. If we select the second red as the program background color and save the image with "background set as transparent", here is what we will see:
This is the part the confuses people so easily. Sometimes you will have an image with what looks like a single color background (let's say it's white) and you set white as transparent but you find not all of the background ends up as you want it. The image has a splotchy look where you expect transparency. Maybe even large areas are still the color you thought you had set to transparent!
Add a new color to the palatte that is not similar to any other color in the graphic. I typically use hot pink or bright yellow... something different that will stand out and make editing easier:
Next, pour this color into all the areas in your picture that are (or appear to be) the color you want for the background color -- in our example this would be the two red areas:
Set the graphic's background color designation to hot pink:
Finally save the graphic with the background set to transparent:
On complex graphics with many areas of the same color (but different cells) this process can be a little tedious but if you work it through using the zoom function of your graphics program, you will be very pleased with the results.
|