Page 1 of 1
Colours in PNG images not displayed properly
Posted: Sat Mar 25, 2006 2:28 am
by Zefram
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
Posted: Sat Mar 25, 2006 8:14 am
by helmut
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
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...
Re: bug with png images
Posted: Sat Mar 25, 2006 8:57 am
by xnview
helmut wrote: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
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...
I can't confirm, i have 580 unique colors, and all is ok...
Strange PNG…
Posted: Sat Mar 25, 2006 4:37 pm
by Clo

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,
Posted: Sun Mar 26, 2006 8:25 am
by XnTriq
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.
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”).
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).
Posted: Sun Mar 26, 2006 9:11 am
by xnview
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?
Right it's a 32bits png file....
Posted: Sun Mar 26, 2006 11:00 am
by XnTriq
xnview wrote: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?
Right it's a 32bits png file....

Hi Pierre!
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
Posted: Sun Mar 26, 2006 12:35 pm
by Clo
—>
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
Posted: Sun Mar 26, 2006 4:10 pm
by XnTriq

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:
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.

Related discussions:
Posted: Mon Mar 27, 2006 7:40 am
by xnview
XnTriq wrote:xnview wrote: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?
Right it's a 32bits png file....

Hi Pierre!
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?
But do you have "compose image with alpha"???
Posted: Thu Mar 30, 2006 4:00 am
by XnTriq
http://www.libpng.org/pub/png/images/balloons-aj.png
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