Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to get better transparency with GIFs?

Is there any software, plugin or technique that would allow creating/exporting PNG-like GIFs with smooth transparent edges, at least for smaller images like bullets or buttons.

I really have to use GIFs sometimes for IE6 so it'd would be great to know if such a tool exists?

Thanks

like image 550
eozzy Avatar asked Dec 23 '09 11:12

eozzy


People also ask

How do I increase the clarity of a GIF?

Here are some important tips you should know to increase the quality of GIFs. Implement lossy LZW compression instead of Gifsicle or Lossy GIF encoder. Choose the best size/quality ratio when converting video or photo to GIF. To avoid frame drop and enhance GIF, you should also choose the best frame rate.

Can you have transparency in GIFs?

GIF and PNG‑8 formats support one level of transparency—pixels can be fully transparent or fully opaque, but not partially transparent. (By contrast, PNG‑24 format supports multilevel transparency; that is, you can have up to 256 degrees of transparency in an image, ranging from opaque to completely transparent.)

How does GIF deal with transparency?

The GIF and PNG formats also both support transparency. If you need any level of transparency in your image, you must use either a GIF or a PNG. GIF images (and also PNG) support 1-color transparency. This basically means that you can save your image with a transparent background.

How do you make a GIF translucent?

To make all frames transparent, enter the "*" symbol. You can also turn on the built-in GIF player and view the transparent GIF frame by frame.


2 Answers

No, the GIF format does not support alpha-channel transparency like PNG does. You can only select one out of the 256 possible colors in a GIF to be transparent.

If you know roughly what color the background will be, the best you can do is create the GIF with the same background you plan to use it on, then select the background color as transparent. The smooth edges will look smooth against that specific background, but horrible against other colors.

like image 106
jakber Avatar answered Sep 28 '22 08:09

jakber


The edges in a PNG are smooth because of anti-aliasing, and thus, variable opacity. The GIF format doesn't support this, so unfortunately no there isn't a way to do it.

like image 44
Nate B Avatar answered Sep 28 '22 06:09

Nate B