Web graphics experts. Possible to specify a colour as the transparency in a gif?

I have an animated gif which has a black background.

Without editing the gif itself is it possible to set the black as the transparency? So that on a page who’s background is non-black the black parts of the gif are replaced by the colour of the page’s background?

I have an oldish version of Paint Shop Pro (version 7) that allows you to save a gif and set which color will be transparent. I think it doesn’t blend the edges as well if you do it that way though, so it might still look a little wonky.

There might be freeware programs that would do the same thing but I am afraid I don’t know of a specific one.

I think if you make the gif so the black is transparent, by definition that is editing the file.

That said, yes it should be possible and relatively easy to do.
If you don’t have any other graphics programs available to you, you can try gimp out. It should be able to handle that task fine.

Short answer is no, you have to edit the GIF itself to specify a transparent color.

Long answer… uh, in theory maybe you could do some fancy JavaScript/Java/Flash programming to overlay the background color on top of the correct parts of your GIF… but that’d be utterly stupid. Is there a reason you can’t edit the GIF?

If I remember correctly, PSP7 lets you choose a color closest to the actual background color and will then dither the transparency to make it more seamless.

An animated GIF is composed of a number of individual GIFs. I am guessing you will have to edit the palette of each and every single frame to define the transparent color. . I do not think it can be done globally for all frames but I could be wrong.

After I posted I caught that it was animated. PSP7 has an animation program (Animation Shop) that allows you to set a transparency color for the entire sequence. But yeah, you will need a program that can work with animated gifs.

That’s true, there is a “blend with background color” you can choose when optimizing the gif that would probably help. But the image may already be blended to the original background color so I think you might still get some residual wonkiness, depending on how the image was done. But I am not really the “expert” that the thread title request so I could be wrong.

And I don’t think the blending and dithering is an option in Animation Shop so you would have to export all the frames there, send them back to PSP to set the transparancy, then re-assemble them in Animation shop.

Also, bear in mind that anything currently black in the image will become transparent if you set black to transparency. If you need some parts of the image to display as black, there is a color replacer tool you can use to change the background color to something else, then set that color to transparent. But again, it is tricky to work with if the colors are blended at the edges.

XNView is an excellent photo (and it works for gifs) manipulator and it’s free.

You can also go to gifworks.com, which is an online image manipulator.

I ended up doing it in adobe fireworks (which I have at work). I just set black as the transparent colour and it worked. I didn’t need to do it for each frame.

But it doesn’t look right because there are areas of black that could do with staying black. (I reasoned that it would be shown on dark blue so it wouldn’t be noticeable)

Fill in the areas that you want to be transparent with another color (flaming fuschia is what we used back in the day) and then choose that to be transparent, not black.