Colours in PNG images not displayed properly
Moderators: XnTriq, helmut, xnview
Colours in PNG images not displayed properly
Every PNG-image I export from Inkscape (a vector drawing program) is incorrectly displayed in xnview (1.82.2). Grey values appear as black. The curious thing is that the thumbnails are correct!
Example Image:
http://commons.wikimedia.org/wiki/Image ... roblem.png
Example Image:
http://commons.wikimedia.org/wiki/Image ... roblem.png
Re: bug with png images
I can confirm. I've downloaded your PNG image and it can be clearly seen that XnView does not display all colours. The image has 578 different colours, whereas XnView counts only 167. I guess Pierre can say more...Zefram wrote:Every PNG-image I export from Inkscape (a vector drawing program) is incorrectly displayed in xnview (1.82.2). Grey values appear as black. The curious thing is that the thumbnails are correct!
Example Image:
http://commons.wikimedia.org/wiki/Image ... roblem.png
Re: bug with png images
I can't confirm, i have 580 unique colors, and all is ok...helmut wrote:I can confirm. I've downloaded your PNG image and it can be clearly seen that XnView does not display all colours. The image has 578 different colours, whereas XnView counts only 167. I guess Pierre can say more...Zefram wrote:Every PNG-image I export from Inkscape (a vector drawing program) is incorrectly displayed in xnview (1.82.2). Grey values appear as black. The curious thing is that the thumbnails are correct!
Example Image:
http://commons.wikimedia.org/wiki/Image ... roblem.png
Pierre.
Strange PNG…
Hello !
- I get only 167 colours here like Helmut says (display set @ 16 BPP in the PC) under XP-Pro SP1 - XnView 1.82.4
- Moreover, playing with that image a good while (in the browser >> View etc), I got strange behaviours like : the thumb-nails display delayed by one minute, then a pretty freeze = Alt + Ctrl + Del to kill the process !
- I guess that there is something “abnormal” in that PNG…
Kind regards,
- I get only 167 colours here like Helmut says (display set @ 16 BPP in the PC) under XP-Pro SP1 - XnView 1.82.4
- Moreover, playing with that image a good while (in the browser >> View etc), I got strange behaviours like : the thumb-nails display delayed by one minute, then a pretty freeze = Alt + Ctrl + Del to kill the process !
- I guess that there is something “abnormal” in that PNG…
Kind regards,
Old user ON SELECTIVE STRIKE till further notice •
If Compose image with alpha 32bits (Options » Read » PNG) is activated XnView displays the image correctly. But why isn't 32 bits in the Image menu grayed out?
TweakPNG 1.2.0 says Nachbarschafts-Randproblem.png is a 32-bit RGBA (truecolor + alpha channel) with no bKGD chunk present. I ran a validity check: “No problems found.”
Paint Shop Pro 8.10 counts 166 colors before the alpha channel is removed, and 581 colors once the image is flattened.
I****View 3.91 on the other hand sees 451 unique colors.
I think it boils down to the rather philosophical question whether or not two pixels should be considered as having the same color if one is — for instance — red with an opacity value of 128 (50%), and the another one is red also, but has just 25% (64) opacity.
TweakPNG 1.2.0 says Nachbarschafts-Randproblem.png is a 32-bit RGBA (truecolor + alpha channel) with no bKGD chunk present. I ran a validity check: “No problems found.”
Paint Shop Pro 8.10 counts 166 colors before the alpha channel is removed, and 581 colors once the image is flattened.
I****View 3.91 on the other hand sees 451 unique colors.
I think it boils down to the rather philosophical question whether or not two pixels should be considered as having the same color if one is — for instance — red with an opacity value of 128 (50%), and the another one is red also, but has just 25% (64) opacity.
PNG — The Definitive Guide: [url=http://www.libpng.org/pub/png/book/chapter01.html]Chapter 1. An Introduction to PNG[/url] (??/Jun/1999) wrote:A channel, on the other hand, refers to the collection of all samples of a given type in an image — for example, the green components of every RGB pixel. Thus a truecolor image has three channels, while a grayscale image has only one. (Ordinarily one does not speak of a palette-based image as having channels.) And when discussing transparency, yet another channel type is often used: the alpha channel. This is a special kind of channel in that it does not provide actual color information but rather a level of transparency for each pixel — or, more precisely, a level of opacity, since it is most common for the maximum sample value to indicate that the pixel is completely opaque and for zero to indicate complete transparency. A truecolor image with an alpha channel is often called an RGBA image; grayscale images with alpha channels are rarer and don't have a special abbreviation (although I may refer to them as “gray+alpha”).
[url=http://www.libpng.org/pub/png/spec/1.2/PNG-Glossary.html]Portable Network Graphics (PNG) Specification, Version 1.2[/url] (??/Aug/1999) wrote:Alpha | A value representing a pixel's degree of transparency. The more transparent a pixel, the less it hides the background against which the image is presented. In PNG, alpha is really the degree of opacity: zero alpha represents a completely transparent pixel, maximum alpha represents a completely opaque pixel. But most people refer to alpha as providing transparency information, not opacity information, and we continue that custom here.
[url=http://www.libpng.org/pub/png/spec/iso/index-object.html]Portable Network Graphics (PNG) Specification, Second Edition[/url] (10/Nov/2003) wrote:alpha | a value representing a pixel's degree of opacity. The more opaque a pixel, the more it hides the background against which the image is presented. Zero alpha represents a completely transparent pixel, maximum alpha represents a completely opaque pixel.
A Guide to Inkscape: Glossary wrote:alpha | The transparency of an object (or pixel). If an object with a non-maximal value of alpha is placed over another object, the second object will be visible under the first. In Inkscape a value of Alpha of 255 means the object is completely opaque while a value of 0 means it is fully transparent (not visible).
Last edited by XnTriq on Sun Mar 26, 2006 3:05 pm, edited 1 time in total.
Hi Pierre!xnview wrote:Right it's a 32bits png file....XnTriq wrote:If Compose image with alpha 32bits (Options » Read » PNG) is activated XnView displays the image correctly. But why isn't 32 bits in the Image menu grayed out?
When I open a 32-bit image in View mode and pull down the Image menu, the True Colour (= 24-bit truecolor) option is grayed out, while the 32 bits (= 32-bit truecolor) option is not.
Please correct me if I'm wrong, but shouldn't it be the other way around, because the color depth of the image can only be decreased?
Not here
—> XnTriq
Hello !
- I just tested again with normal 32 BPP PNGs : the 32-bit entry is blurred alright like it should, while the True colour one is active…
Kind regards, cordialement,
Claude
Clo
Hello !
- I just tested again with normal 32 BPP PNGs : the 32-bit entry is blurred alright like it should, while the True colour one is active…
Kind regards, cordialement,
Claude
Clo
Old user ON SELECTIVE STRIKE till further notice •
Hi Clo!
Thanks for the tip. In the meantime I've been fooling around with these 32-bit RGBA PNGs from the official PNG site.
XnView indicates 32-bit color depth in the status bar only when Compose image with alpha (32bits) is deactivated. Areas with 100% transparency (or zero opacity) appear as black. Image » 32 bits is grayed out, True Colour is not.
In all other configuration settings they're handled as if they had 24-bit color depth, and transparent areas are displayed as white.
Could this be a solution to the problem described by Zefram:
Thanks for the tip. In the meantime I've been fooling around with these 32-bit RGBA PNGs from the official PNG site.
XnView indicates 32-bit color depth in the status bar only when Compose image with alpha (32bits) is deactivated. Areas with 100% transparency (or zero opacity) appear as black. Image » 32 bits is grayed out, True Colour is not.
In all other configuration settings they're handled as if they had 24-bit color depth, and transparent areas are displayed as white.
Could this be a solution to the problem described by Zefram:
Related discussions:Inkscape Wiki FAQ wrote:Q: The PNGs exported by Inkscape have jagged edges/no antialiasing/funny background.
[...]
If you want to open the exported PNG bitmaps in MS-Word, you will also have to change the alpha-opacity (in document-properties dialog) to full, and then export — the result will be much better.
- Topic #0561: Transparent PNG: Configurable background colour
- Topic #1389: PNG Opacity
- Topic #3058: Better 32-bit Alpha PNG Support
- Topic #3662: PNG - thumbnail != image
- Topic #4269: Alpha channel transparency
- Topic #4587: PNG and saving transpareny
- Topic #4981: xnview doesnt display .png with transparency correctl
- Topic #5258: Specify bg color for image transparency...
- Topic #5390: SDK - Ecrire son propre plugin (fr » en: AltaVista Babel Fish · Google Language Tools)
- Topic #5396: Problème avec certain PNG (avec un nb de tag minimaliste) (fr » en: AltaVista Babel Fish · Google Language Tools)
- Topic #5595: How to set PNG transparency color?
Last edited by XnTriq on Sun Apr 02, 2006 3:30 pm, edited 3 times in total.
But do you have "compose image with alpha"???XnTriq wrote:Hi Pierre!xnview wrote:Right it's a 32bits png file....XnTriq wrote:If Compose image with alpha 32bits (Options » Read » PNG) is activated XnView displays the image correctly. But why isn't 32 bits in the Image menu grayed out?
When I open a 32-bit image in View mode and pull down the Image menu, the True Colour (= 24-bit truecolor) option is grayed out, while the 32 bits (= 32-bit truecolor) option is not.
Please correct me if I'm wrong, but shouldn't it be the other way around, because the color depth of the image can only be decreased?
Pierre.
http://www.libpng.org/pub/png/images/balloons-aj.png
http://www.libpng.org/pub/png/img_png/s ... l_rgba.png
Intel 82815 Graphics Controller 6.13.1.3196 • Windows 2000 SP4 • XnView 1.82.4
Code: Select all
Chunk | Contents
------+-----------------------------------------------------------------------
IHDR | PNG image header: 80x87, 8 bits/sample, truecolor+alpha, noninterlaced
sBIT | significant bits/sample: R:8,G:8,B:8,A:8
tEXt | standard text: [Software]=[www.inkscape.org]
IDAT | PNG image data
IDAT | PNG image data
IEND | end-of-image marker
TweakPNG 1.2.1
http://www.libpng.org/pub/png/img_png/s ... l_rgba.png
Code: Select all
Chunk | Contents
------+----------------------------------------------------------------------
IHDR | PNG image header: 162x150, 8 bits/sample, truecolor+alpha, interlaced
gAMA | file gamma = 1.00000
IDAT | PNG image data
IDAT | PNG image data
IDAT | PNG image data
IDAT | PNG image data
IEND | end-of-image marker
TweakPNG 1.2.1
Intel 82815 Graphics Controller 6.13.1.3196 • Windows 2000 SP4 • XnView 1.82.4