Bug 38735 - ImageBuffer::transformColorSpace : linear RGB -> sRGB conversion formula error
Summary: ImageBuffer::transformColorSpace : linear RGB -> sRGB conversion formula error
Status: RESOLVED FIXED
Alias: None
Product: WebKit
Classification: Unclassified
Component: SVG (show other bugs)
Version: 528+ (Nightly build)
Hardware: PC All
: P2 Normal
Assignee: Nobody
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2010-05-07 03:46 PDT by Zoltan Herczeg
Modified: 2010-05-07 23:32 PDT (History)
4 users (show)

See Also:


Attachments
patch (2.24 KB, patch)
2010-05-07 03:57 PDT, Zoltan Herczeg
no flags Details | Formatted Diff | Diff
Updated ChangeLog (2.31 KB, patch)
2010-05-07 04:10 PDT, Zoltan Herczeg
no flags Details | Formatted Diff | Diff
change pow to powf (2.31 KB, patch)
2010-05-07 21:08 PDT, Zoltan Herczeg
krit: review+
Details | Formatted Diff | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Zoltan Herczeg 2010-05-07 03:46:04 PDT
let f(x) = ((x + 0.055) / 1.055) ^ 2.4

f(x)^(-1) (inverted formula) is ((x ^ (1 / 2.4)) * 1.055) - 0.055
instead of ((x * 1.055) ^ (1 / 2.4)) - 0.055
Comment 1 Zoltan Herczeg 2010-05-07 03:57:13 PDT
Created attachment 55357 [details]
patch
Comment 2 Zoltan Herczeg 2010-05-07 04:10:16 PDT
Created attachment 55359 [details]
Updated ChangeLog
Comment 3 Darin Adler 2010-05-07 17:31:51 PDT
Comment on attachment 55359 [details]
Updated ChangeLog

> +                color = (pow(color, 1.0f / 2.4f) * 1.055f) - 0.055f;

Shouldn't this be powf? Using pow means we'll convert to double and then back to float.
Comment 4 Zoltan Herczeg 2010-05-07 21:08:54 PDT
Created attachment 55458 [details]
change pow to powf

Darin, nice catch.
Comment 5 Dirk Schulze 2010-05-07 21:48:39 PDT
(In reply to comment #3)
> (From update of attachment 55359 [details])
> > +                color = (pow(color, 1.0f / 2.4f) * 1.055f) - 0.055f;
> 
> Shouldn't this be powf? Using pow means we'll convert to double and then back
> to float.

Right, sorry. Didn't see  that.
Comment 6 Nikolas Zimmermann 2010-05-07 22:17:40 PDT
This does not affect mac pixel tests?
Comment 7 Dirk Schulze 2010-05-07 22:23:15 PDT
(In reply to comment #5)
> (In reply to comment #3)
> > (From update of attachment 55359 [details] [details])
> > > +                color = (pow(color, 1.0f / 2.4f) * 1.055f) - 0.055f;
> > 
> > Shouldn't this be powf? Using pow means we'll convert to double and then back
> > to float.
> 
> Right, sorry. Didn't see  that.

No it doesn't. The code is just used for Chromium Gtk and Qt.
Comment 8 Zoltan Herczeg 2010-05-07 23:32:06 PDT
Landed in r59002 : http://trac.webkit.org/changeset/59002

Closing bug.