Page 1 of 1

Copy & Pasted Gif images lose transparency

Posted: Mon May 28, 2007 10:28 am
by Satori
Since I use XnView mostly for picture editing and graphics (creating images and border backgrounds for web pages), I've found I can't copy & paste a gif image onto another image/canvas and retain the transparency if I copy it from my picture files.

The odd thing is I can only get a gif image to paste with transparency if I copy it after uploading to the GIFWorks.com edit page - then paste it onto my image in Microsoft Paint. (Even then any white areas in the gif image have 'holes' that need to be touched up with paint)

[The 'Edit colormap' option is no help at all for this either - even if I could figure out how it's supposed to work or for what, as it only saves some code data that then won't open, lol.]

So, can anyone explain why the transparency won't transfer from my picture files or between XnView files, but it will from Gifworks - and then only to Microsoft Paint?

Seems strange to have the copy-paste option if the most common use for that is disfunctional.

e.g. Screenshot 1 the gif with transparency.
Screenshot 2 - after pasting to image.

Am I missing some process here or is this something that needs to be added/fixed?

Any help will be much appreciated :)

Posted: Mon May 28, 2007 12:53 pm
by Drahken
I have never heard of an imaging program which DOES retain transparency when cutting & pasting. I have no idea how/why copying from gifworks into M$ paint works, but it's the exception to the rule.

The issue with copying & pasting transparency is that any time you copy an images in windows (don't know about other OSes), it copies the image as a truecolor image. Transparency only works in indexed/256 color images, or if there's an alpha channel (but as far as I know, windows doesn't copy alpha channels either).
What you need to do is use the colormap function after pasting. The reason it won't open for you is because of what I mentioned earlier, the image is pasted as truecolor. (After you paste an image, if you look at the status bar in the lower left, you'll see the dimensions of the image followed by a third number, like 200x200x24. The 24 means it's in 24bit color mode (aka "truecolor"), and indexed image would say 200x200x8.)
Follow these steps:
1) Paste your image.
2) Click on Image->convert to colors->256 colors (adaptive)
3) NOW go to edit colormap (the colormap only works on images of 256 colors or less, because images with more colors don't HAVE a colormap to edit).
4) In the colormap, select the color that you think is the background color, then check the "enable transparency" box and close the colormap window. If that was the wrong one, just open the colormap again and choose a different one.


The best way to deal with transparency however, is to save the image to your computer and then open it with xnview. If you do it that way, then you won't lose the transparency settings.