Menu

#10 high-level interface needs sRGB and linear flags

open
nobody
None
5
2012-12-18
2004-12-01
No

For high-level control of gamma, simply add:

PNG_TRANSFORM_SRGB Convert to sRGB gamma
PNG_TRANSFORM_LINEAR Convert to gamma==1.0

In the documentation, note that:

1. sRGB must be used for normal displays

2. linear must be used for most image processing, including
alpha blending and scaling

Discussion

  • Glenn Randers-Pehrson

    Logged In: YES
    user_id=7859

    what should these transforms do when the input file lacks
    gamma info?

     
  • Albert Cahalan

    Albert Cahalan - 2005-01-08

    Logged In: YES
    user_id=18352

    The best you can do without gamma info is to assume that sRGB
    has been used. The vast majority of unmarked images are in this
    format. Probably the image was done by eye on a normal display.
    This is the case with Tux Paint images for example.

    BTW, if gamma is specified and is within a few percent of sRGB,
    you might just consider that to be close enough. Probably a
    good number of apps are crudely encoding the gamma.

     

Log in to post a comment.