How to set icc color profile in Java and change colorspace

前端 未结 1 927
走了就别回头了
走了就别回头了 2021-01-01 06:50

First, I would like to say I\'m not an image processing specialist.

I would like to convert image colorspace from one to another, and change icc color profile at the

相关标签:
1条回答
  • 2021-01-01 07:43

    Use ColorConvertOp, this will do the color space conversion. You have several options to set a icc color profile. Either you use a predefined profile by using getInstance with the correct color space constant or you can specify a file, which contains a profile. Here is an example:

    ICC_Profile ip = ICC_Profile.getInstance( ColorSpace.CS_sRGB );
    ICC_ColorSpace ics = new ICC_ColorSpace( ip );
    ColorConvertOp cco = new ColorConvertOp( ics, null );
    BufferedImage result = cco.filter( sourceImage, null );
    

    The result will contain an image with the sRGB color space.

    0 讨论(0)
提交回复
热议问题