Gamma in PNG

Bugs found in XnView Classic. Please report only one bug per topic!

Moderators: XnTriq, xnview

Post Reply
Solovei95
Posts: 16
Joined: Tue Mar 29, 2011 11:14 am

Gamma in PNG

Post by Solovei95 » Thu Nov 17, 2011 11:34 am

It does not work PNG gamma correction

User avatar
xnview
Author of XnView
Posts: 31737
Joined: Mon Oct 13, 2003 7:31 am
Location: France
Contact:

Re: Gamma in PNG

Post by xnview » Fri Nov 18, 2011 8:30 am

Solovei95 wrote:It does not work PNG gamma correction
You means that gamma in PNG are not used?
Pierre.

Solovei95
Posts: 16
Joined: Tue Mar 29, 2011 11:14 am

Re: Gamma in PNG

Post by Solovei95 » Wed Nov 23, 2011 11:32 am

XnView does not work native gamma correction in PNG.
The simplest formula is:
pow (channel/255, 1 / (gamma * 2.2));

gamma - gamma from PNG gAMA chunk
channel - RGB channel

User avatar
DOS386
Posts: 291
Joined: Sun Jun 11, 2006 2:43 pm

Re: Gamma in PNG

Post by DOS386 » Wed Nov 23, 2011 2:46 pm

Solovei95 wrote:XnView does not work native gamma correction in PNG.
The preferred colorspace is sRGB anyway, not pow(unpredictable random value).

http://libpng.org/pub/png/book/chapter1 ... ch10.div.6

http://libpng.org/pub/png/spec/1.2/PNG- ... tml#C.sRGB

http://en.wikipedia.org/wiki/SRGB
There is indeed no WinZIP under my rock.

User avatar
XnTriq
Moderator & Librarian
Posts: 5447
Joined: Sun Sep 25, 2005 3:00 am
Location: Ref Desk

Re: Gamma in PNG

Post by XnTriq » Wed Nov 23, 2011 11:45 pm


Post Reply