View Full Version : Transparent image background
dteare
10-17-2004, 09:51 AM
Hi all,
I would like to place an image on top of another image and I don't want to see the background color of the top image. The background of the top image is white and I would like it to be transparent.
I read the docs and it mentioned by default the background of SWF files are transparent, but how do I do this for a jpg/png?
Thanks!
--Dave.
mericson
10-17-2004, 10:29 AM
I thought the docs implied you have to use SWF for alpha-channel effects.
However it would be nice since GIF has a way to define a transparency color, and PNG has a way to define an alpha-channel to convert those into SWF automatically to be able to do transparency. Doing transparency with JPEG is a little more tricky because of its lossiness.
dteare
10-17-2004, 10:38 AM
I thought the docs implied you have to use SWF for alpha-channel effects.
I think you're right. I am an enterprise java developer and am just starting to pick up the imaging lingo :O
Do you think if I set the transparency colour in a gif LZX would honour it?
--Dave.
peter
10-17-2004, 04:18 PM
You can definitely use transparent or alpha-masked bitmaps as resources in LZX. PNGs tend to be the most effective method of doing this (Vector-based SWF files are another topic). The reason I lean towards using the PNG format is that it supports 8 bit alpha as opposed to the 1 bit that GIFs utilize.
Transparency in the GIF format means that a pixel is either visible or not. Alpha in PNG lets each pixel have 256 variations of opacity.
This means that if you have a complex image edge, you will have elegant and faithful anti-aliasing (GIFs will have hard drop-off between the image and its mask). If the image you are using has hard edges (stops at an opaque pixel) and you simply want to mask that shape w/out worrying about anti-aliasing, a GIF would work fine, and also be a smaller file (bytes).
If you decide to use the PNG fomat, you will need to delete the white area in your file before saving it. You have to have an alpha mask in place as opposed to specifying a color to be rendered as transparent.
vBulletin® v3.8.4, Copyright ©2000-2012, Jelsoft Enterprises Ltd.