PNG and saving transpareny

Ideas for improvements and requests for new features in XnView Classic

Moderators: XnTriq, xnview

Post Reply
klumy
Posts: 229
Joined: Sat Jun 18, 2005 9:33 am

PNG and saving transpareny

Post by klumy »

hello,

in IrfanView it is possible to set which colour should be transpareny if you save a PNG image, by clicking on the colour of the image.

Such a feature would be really useful for XNView.
I often use this feature because I use the image for Powerpoint. So the unuseful background of the image is transparent and can easily be integrated into powerpoint
XNView 1.91.5
Windows XP SP3
User avatar
xnview
Author of XnView
Posts: 33840
Joined: Mon Oct 13, 2003 7:31 am
Location: France
Contact:

Re: PNG and saving transpareny

Post by xnview »

klumy wrote:in IrfanView it is possible to set which colour should be transpareny if you save a PNG image, by clicking on the colour of the image.

Such a feature would be really useful for XNView.
I often use this feature because I use the image for Powerpoint. So the unuseful background of the image is transparent and can easily be integrated into powerpoint
You can do that by editing colormap ("Image > Edit color map").
Pierre.
klumy
Posts: 229
Joined: Sat Jun 18, 2005 9:33 am

Post by klumy »

this feature is invisible here
XNView 1.91.5
Windows XP SP3
User avatar
helmut
Posts: 8219
Joined: Sun Oct 12, 2003 6:47 pm
Location: Frankfurt, Germany

Post by helmut »

klumy wrote:this feature is invisible here
If your image is not a palette image (<=256 colours), you won't be able to edit the colour palette and set transparency in XnView.

I even think that it's not possible at all to set transparency for PNGs with more than 256 colours.
klumy
Posts: 229
Joined: Sat Jun 18, 2005 9:33 am

Post by klumy »

I don't think its dependable from the number of colours

I have some PNG with more than 256 colors created with IRfanView and they also support transparency
XNView 1.91.5
Windows XP SP3
User avatar
xnview
Author of XnView
Posts: 33840
Joined: Mon Oct 13, 2003 7:31 am
Location: France
Contact:

Post by xnview »

klumy wrote:I don't think its dependable from the number of colours

I have some PNG with more than 256 colors created with IRfanView and they also support transparency
So you want to set the transparency for one color, and for a picture more than 256 colors?
Pierre.
User avatar
Drahken
Posts: 884
Joined: Sun Apr 10, 2005 4:29 pm

Post by Drahken »

That is an official feature of PNGs. You can use alpha transparency on either a 256, a greyscale, or a truecolor PNG (although most progs only allow creating truecolor and greyscale PNGs with alpha transparency), and you can use single color transparency on a 256 color, a greyscale, or a truecolor PNG. In fact, one workaround for M$IE's crappy PNG support is to set a transparent color in the image AND set an alpha transparency. Decent browsers will show the image with the alpha transparency, and M$IE will fallback to single color transparency.
The problem is, I don't know how xnview would allow you to choose a single transparent color for PNGs with >256 colors, since such images don't have a "palette" (as such, all images have a palette).

As far as choosing the transparent color for 256 or less images, it works fine for me, I've used it several times.
Oh the feuhrer, oh the feuhrer, oh the feuhrer's nipples bonk!
User avatar
xnview
Author of XnView
Posts: 33840
Joined: Mon Oct 13, 2003 7:31 am
Location: France
Contact:

Post by xnview »

Drahken wrote:That is an official feature of PNGs. You can use alpha transparency on either a 256, a greyscale, or a truecolor PNG (although most progs only allow creating truecolor and greyscale PNGs with alpha transparency), and you can use single color transparency on a 256 color, a greyscale, or a truecolor PNG. In fact, one workaround for M$IE's crappy PNG support is to set a transparent color in the image AND set an alpha transparency. Decent browsers will show the image with the alpha transparency, and M$IE will fallback to single color transparency.
The problem is, I don't know how xnview would allow you to choose a single transparent color for PNGs with >256 colors, since such images don't have a "palette" (as such, all images have a palette).

As far as choosing the transparent color for 256 or less images, it works fine for me, I've used it several times.
Currently single color for transparency on a 24bits picture is not possible
Pierre.
User avatar
Drahken
Posts: 884
Joined: Sun Apr 10, 2005 4:29 pm

Post by Drahken »

Here's a quick demo I made if anyone wants to play around with it:
http://allspark.net/cypherswipe/trans-truecolor-png.png
Note: Not all browsers or viewers can handle this kind of transparency. Gecko based browsers such as netscape and firefox handle it fine, I'm pretty sure opera does too. FYI the big area in the middle is the transparent part.
Oh the feuhrer, oh the feuhrer, oh the feuhrer's nipples bonk!
User avatar
GeorgD
Posts: 283
Joined: Thu Oct 12, 2006 2:45 pm

Post by GeorgD »

xnview wrote:Currently single color for transparency on a 24bits picture is not possible
Is this still (1.90beta2) the current state? I understood your post (Fri Oct 29, 2004 in http://newsgroup.xnview.com/viewtopic.php?t=561) differently *confused*

/Georg
User avatar
dma_k
Posts: 85
Joined: Tue Apr 14, 2009 8:50 am

Re: PNG and saving transpareny

Post by dma_k »

xnview wrote:You can do that by editing colormap ("Image > Edit color map").
Thanks for the hint. First I wrongly tried to play with Options > Genral Write > PNG > Set the transparency value, then I learned how to use a Image > Edit color map, I finally understood that I need to use not more than 265 colors in order File > Export > PNG > Set transparency color button to get enabled :D
User avatar
Jaff
Posts: 67
Joined: Fri Dec 07, 2007 8:55 am
Location: Romania
Contact:

Post by Jaff »

xnview wrote:Currently single color for transparency on a 24bits picture is not possible
That's not a problem. XN can generate a warning window to increase number of colors to RGBA (32bit) and continue to generate mask from the chosen color.
Imi este indiferent ce cred ceilalti despre mine, caci oricum fiecare crede ce-i convine lui si nu ceea ce e real, doar ca mi-ar fi placut sa ma vada asa cum sint de fapt, nu asa cum poate le-ar placea lor sa creada. Ei au ales deja...
MaxSt
Posts: 133
Joined: Fri Apr 10, 2009 9:55 pm

Re:

Post by MaxSt »

Jaff wrote:That's not a problem.
Incomplete support for PNG format *is* a problem for XnView.
Post Reply