commons-issues mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Stephan Köninger (JIRA) <j...@apache.org>
Subject [jira] [Comment Edited] (IMAGING-147) Color constants
Date Tue, 06 Jan 2015 20:39:35 GMT

    [ https://issues.apache.org/jira/browse/IMAGING-147?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=14266693#comment-14266693
] 

Stephan Köninger edited comment on IMAGING-147 at 1/6/15 8:39 PM:
------------------------------------------------------------------

Hi,

I have created another patch file which is based on the current SVN trunk (instead of GIT
head - sorry for that). I corrected the copy past error.

The "odd" values are a result of color model conversions. For instance: If one wants to convert
the color red which is (255,0,0) in RGB to XYZ color model, one has to use a formula as follows:
(Assumption: White point is D65 and observer 2° as stated in ColorConversion line 85)
{noformat}
[ X ]   [ 0.4124 0.3576 0.1804 ]   [ R ]
[ Y ] = [ 0.2127 0.7152 0.0722 ] * [ G ]
[ Z ]   [ 0.0193 0.1192 0.9502 ]   [ B ]
{noformat}

(Hint: The given matrix is based on sRGB color space: http://www.brucelindbloom.com/index.html?Eqn_RGB_XYZ_Matrix.html)

So color red will be 41.24, 21.26, 1.93. Other colors like Luv are now derived from this XYZ
values and so on.

Regards
Stephan


was (Author: stephan.koeninger):
Hi,

I have created another patch file which is based on the current SVN trunk (instead of GIT
head - sorry for that). I corrected the copy past error.

It would be nice to add a "convertTo" method to all color classes, which is able to convert
a color to other color models. By adding documentation to this method it will be much clearer
why the values for color models like Luv look odd to you. 

Regards
Stephan

> Color constants
> ---------------
>
>                 Key: IMAGING-147
>                 URL: https://issues.apache.org/jira/browse/IMAGING-147
>             Project: Commons Imaging
>          Issue Type: Improvement
>          Components: imaging.color.*
>            Reporter: Benedikt Ritter
>              Labels: github
>             Fix For: Review Patch
>
>         Attachments: IMAGING-147_001.patch, IMAGING-147_002.patch
>
>
> The Color classes should provide constants for useful colors like black, white and maybe
their base colors. For example ColorCmyk could provide Constants for black, white, cyan, magenta
and yellow ColorCmyk objects.



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)

Mime
View raw message