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

Tilman Hausherr commented on PDFBOX-2553:
-----------------------------------------

new code:
{code}
    public float[] toRGB(float[] value)
    {
        float a = value[0];
        float b = value[1];
        float c = value[2];
        Matrix matrix = getGammaMatrix();
        PDGamma gamma = getGamma();
        float x = (float) (matrix.getValue(0, 0) * Math.pow(a, gamma.getR()) + 
matrix.getValue(0, 1) * Math.pow(b, gamma.getG()) + matrix.getValue(0, 2) * 
Math.pow(c, gamma.getB()));
        float y = (float) (matrix.getValue(1, 0) * Math.pow(a, gamma.getR()) + 
matrix.getValue(1, 1) * Math.pow(b, gamma.getG()) + matrix.getValue(1, 2) * 
Math.pow(c, gamma.getB()));
        float z = (float) (matrix.getValue(2, 0) * Math.pow(a, gamma.getR()) + 
matrix.getValue(2, 1) * Math.pow(b, gamma.getG()) + matrix.getValue(2, 2) * 
Math.pow(c, gamma.getB()));
        return CIEXYZ.toRGB(new float[] { x, y, z });
    }
{code}
will do tests and have sleep first before committing.

> CalRGB colors different
> -----------------------
>
>                 Key: PDFBOX-2553
>                 URL: https://issues.apache.org/jira/browse/PDFBOX-2553
>             Project: PDFBox
>          Issue Type: Bug
>          Components: Rendering
>    Affects Versions: 2.0.0
>            Reporter: simon steiner
>              Labels: CalRGB
>         Attachments: PDFBOX-2553.pdf-1.png, anna-iptimgx330.pdf-1.png, 
> pdfbox-2553.pdf-1-NEWIMPROVED.png
>
>
> http://acroeng.adobe.com/Test_Files/images/jpeg2000//Anna-IptImgx330.pdf
> java -cp 
> pdf-box-svn/app/target/pdfbox-app-2.0.0-SNAPSHOT.jar:/path/jai_imageio.jar 
> org.apache.pdfbox.tools.PDFToImage Anna-IptImgx330.pdf



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

Reply via email to