mirror of
https://git.code.sf.net/p/libpng/code.git
synced 2025-07-10 18:04:09 +02:00
[libpng16] Corrected estimate of error in libpng png_set_rgb_to_gray API.
The API is extremely inaccurate for sRGB conversions because it uses an 8-bit intermediate linear value and it does not use the sRGB transform, so it suffers from the known instability in gamma transforms for values close to 0 (see Poynton). The net result is that the calculation has a maximum error of 14.99/255; 0.5/255^(1/2.2). pngstest now uses 15 for the permitted 8-bit error. This may still not be enough because of arithmetic error.
This commit is contained in:
parent
5578c3719e
commit
aa725a375c
8
ANNOUNCE
8
ANNOUNCE
@ -180,6 +180,14 @@ Version 1.6.0beta11 [February 4, 2012]
|
||||
Fix character count in pngstest command in projects/owatcom/pngstest.tgt
|
||||
Revised test-pngstest.sh to report PASS/FAIL for each image.
|
||||
Updated documentation about the simplified API.
|
||||
Corrected estimate of error in libpng png_set_rgb_to_gray API. The API is
|
||||
extremely inaccurate for sRGB conversions because it uses an 8-bit
|
||||
intermediate linear value and it does not use the sRGB transform, so it
|
||||
suffers from the known instability in gamma transforms for values close
|
||||
to 0 (see Poynton). The net result is that the calculation has a maximum
|
||||
error of 14.99/255; 0.5/255^(1/2.2). pngstest now uses 15 for the
|
||||
permitted 8-bit error. This may still not be enough because of arithmetic
|
||||
error.
|
||||
|
||||
Send comments/corrections/commendations to png-mng-implement at lists.sf.net
|
||||
(subscription required; visit
|
||||
|
8
CHANGES
8
CHANGES
@ -3931,6 +3931,14 @@ Version 1.6.0beta11 [February 4, 2012]
|
||||
Fix character count in pngstest command in projects/owatcom/pngstest.tgt
|
||||
Revised test-pngstest.sh to report PASS/FAIL for each image.
|
||||
Updated documentation about the simplified API.
|
||||
Corrected estimate of error in libpng png_set_rgb_to_gray API. The API is
|
||||
extremely inaccurate for sRGB conversions because it uses an 8-bit
|
||||
intermediate linear value and it does not use the sRGB transform, so it
|
||||
suffers from the known instability in gamma transforms for values close
|
||||
to 0 (see Poynton). The net result is that the calculation has a maximum
|
||||
error of 14.99/255; 0.5/255^(1/2.2). pngstest now uses 15 for the
|
||||
permitted 8-bit error. This may still not be enough because of arithmetic
|
||||
error.
|
||||
|
||||
Send comments/corrections/commendations to png-mng-implement at lists.sf.net
|
||||
(subscription required; visit
|
||||
|
@ -848,7 +848,7 @@ get_pixel(Image *image, Pixel *pixel, png_const_bytep pp)
|
||||
static int error_to_linear = 811; /* by experiment */
|
||||
static int error_to_linear_grayscale = 424; /* by experiment */
|
||||
static int error_to_sRGB = 6; /* by experiment */
|
||||
static int error_to_sRGB_grayscale = 11; /* by experiment */
|
||||
static int error_to_sRGB_grayscale = 15; /* libpng error by calculation */
|
||||
static int error_in_compose = 0;
|
||||
static int error_via_linear = 14; /* by experiment */
|
||||
static int error_in_premultiply = 1;
|
||||
|
Loading…
x
Reference in New Issue
Block a user