Page 1 of 2
How to set PNG transparency color?
Posted: Sun Mar 19, 2006 4:52 pm
I searched the forum but didn't find a clear answer to this:
In the PNG options there is a place to enter the palette "entry" for the transparency color.
If I want a specific color in my image to map to transparent (say, magenta), what value do I put in that PNG option?
Perhaps it would be good to display a palette in that dialog?
Posted: Mon Mar 20, 2006 2:45 am
If it's a true color image you'll have to reduce the color depth first.
To determine an index number, go to Image
» Edit Colormap…
(in View mode).
When you move the mouse cursor over a palette entry, the color's index number, its RGB value & the HTML/hex code are displayed in the list box on the right.
Posted: Mon Mar 20, 2006 2:50 am
Thank you very much! I've never done that before.
And yes, I had to reduce the colors of the image. Didn't turn out too badly though... and the transparency worked!
Posted: Mon Mar 20, 2006 9:26 pm
A while back I've written up an FAQ that describes the creation of images with transparency. The FAQ is not finished, yet, here a part which might be useful:
Step 4: Determine the transparent colour
In some images, the background colour is different to all the other colours and it's obvious which is the background colour. But in some images it might be not so obvious.
In this case you can use the colour info to determine the index of the background colour:
a) Select menu "View > Display Colour Information" The mouse cursor's shape will change to a pipette. Also next to the mouse cursor, the index, the RGB colour and Hex value of the colour will be displayed.
b.) Move the mouse cursor to an area fo your image which is the background.
c.) Now remember the index of the colour which ranges from 0..255
Step 5: Set the transparent colour
Now that you have reduced size and set reduced colour depth of your image, you finally set the transparent colour of your image.
For setting the transparent colour (assuming that XnView and your image are still open)
a.) Open the "Colour map" dialog using menu "Image > Edit colour map"
b.) Click onto the colour with the index that you have determined above in Step 3.).
c.) If you have used an odd colour (e.g. magenta) as background, double click onto the selected colour. Now you can change the colour of your transparent colour to whichever colour you like (actually it doesn't matter much, since the colour will be transparent in real life.).
d.) Set the checkbox "Use transparent colour"
Make sure you first perform b.) and then d.), otherwise the transparent colour will not be set properly.
Posted: Sun Aug 20, 2006 10:40 pm
See throught Background
Posted: Fri Aug 25, 2006 4:35 am
Hi I am having a very hard time changing my background color fon my image from a green background to a "see through" background. Is it anybody that can help me with this
Posted: Fri Aug 25, 2006 10:41 am
Image->convert to colors (however many colors you want, adaptive is generally better than dithered)
Image->edit color map
Select the green square, then go over and check the little box that says transparency.
Click "ok", and the areas that were formerly green will now appear whatever background color is set in the program options (but it's actually transparent, just save the image and open it in your web browser to see.)
If you want to change the background color in the program, go tools->options->view and you'll see a box for background color. Keep in mind that this color is only used in the program, and has no effect on the images themselves.
Posted: Sun Dec 03, 2006 12:26 am
I want to bring this topic up again, as IMHO the 1.90beta2 Export wizard shall be able to set the transparency (as checkbox "set transparency for palette entry 0" or - my varoured solution - by popping up the color palette and selecting the color that shall be transparent) when 256colors are selected from the drop down. Thoughts?
Posted: Mon Dec 04, 2006 12:03 pm
GeorgD wrote:I want to bring this topic up again, as IMHO the 1.90beta2 Export wizard shall be able to set the transparency (as checkbox "set transparency for palette entry 0" or - my varoured solution - by popping up the color palette and selecting the color that shall be transparent) when 256colors are selected from the drop down. Thoughts?
Yes, right, i'll try to add it in the 1.90
Posted: Mon Dec 04, 2006 4:58 pm
xnview wrote:Yes, right, i'll try to add it in the 1.90
set transparency value to palette entry
Posted: Tue Apr 10, 2007 9:33 am
i expect this is a redundant topic. if so; if there's a FAQ please FWD me as i couldn't find anything. i found the following to be the "closest match"
what is the function of the "option" parameter:
. . .set transparency value to palette entry
(i believe i have a similar issue w/ png format, however it appears to be covered, i think, in the other thread i've cited above)
Posted: Tue Apr 10, 2007 10:21 pm
GIFs, certain PNGs, and a few othe formats have a palette of only 256 colors (vs the 16 million in JPG, certain other PNGs, and most other formats). GIF has single color transparency only (PNG can have either single color transparency or alpha transparency). If you go into the options and set transparency to palette entry 50, then whichever of the 256 colors in your image is located in palette entry 50 will be saved as transparent. This is not a particularly useful option, since i requires you to know exactly which palette slot white (or whatever color you want to be transparent) is in. It's much better to set transparency from the image->edit colormap option. (If the image is currently in truecolor mode, you need to go image->convert to colors to make the edit colormap option work.)
Posted: Wed Jun 20, 2007 2:02 pm
Hi to all,
On this very same topic, but a little harder question. If I want to batch convert hundreds of pictures which have a consistent background and have them with a transparent background. Is there any possibility to do that ?
I shall first convert them to PNG but then ???
I know that as the background can vary between picture there might be some difficulties. But there should be a way!!!
I have set up some examples here: http://intranet.easyviz.com/gallery2/ma ... itemId=867
Posted: Wed Jun 20, 2007 2:56 pm
To seek the same result, may be another way to is to replace on the original JPG the background with an uniform color like #ffffff. Is it possible ?
Posted: Thu Jun 21, 2007 5:35 pm
arnaud wrote:If I want to batch convert hundreds of pictures which have a consistent background and have them with a transparent background.