How do I convert images between CMYK and RGB in ColdFusion (Java)?

后端 未结 4 778
梦谈多话
梦谈多话 2020-12-09 13:13

I have a need to convert images from CMYK to RGB - not necessarily back again, but hey, if it can be done...

With the release of ColdFusion 8, we got the CFImage tag

4条回答
  •  萌比男神i
    2020-12-09 13:47

    A very simple formula for converting from CMYK to RGB ignoring all color profiles is:

        R = ( (255-C)*(255-K) ) / 255;
        G = ( (255-M)*(255-K) ) / 255;
        B = ( (255-Y)*(255-K) ) / 255;
    

    This code requires CMYK values to be in rage of 0-255. If you have 0 to 100 or 0.0 to 1.0 you'll have to convert the values.

    Hope this will get you started.

    As for the java and ColdFusion interfacing, I'm sorry, but I have no idea how to do that.

提交回复
热议问题