1 Reply Latest reply: Sep 25, 2011 12:58 PM by Chris Cox RSS

    XYZ convertion problem

    fatysekDesign Community Member

      Hi! i need a make conversion from RGB to XYZ

       

       

      X = (R * 0.5767309) + (G * 0.1855540) + (B * 0.1881852)

      Y = (R * 0.2973769) + (G * 0.6273491) + (B * 0.0752741)

      Z = (R * 0.0270343) + (G * 0.0706872) + (B * 0.9911085)

       

       

      something like this, any idea how to do this? how to have access to each channel simultaneously? i khow i can use AdvancedProc() but i dont know how to do this, can anyone give a sample of code?

       

       

      I will be very grateful.

        • 1. Re: XYZ convertion problem
          Chris Cox Adobe Employee

          Most of the filter examples in the SDK should show you how to get interleaved channel data.

           

          But you're missing some things.

          That's a fixed matrix that converts from ONE RGB space to XYZ, and you haven't taken into account the colorspace of the document (sRGB and AdobeRGB would need different matrices).

          Also, you haven't done anything to convert from gamma encoded data to linear (gamma 1.0 data) - which also needs to use the document colorspace/profile.