BufferedImage colour change

前端 未结 2 1802
南旧
南旧 2021-01-25 19:07

I have working on an application which captures screen shots and create video from captured images. But the problem is that when video is generated, colours in generated video i

相关标签:
2条回答
  • 2021-01-25 19:51

    Use BufferedImage.TYPE_INT_ARGB or BufferedImage.TYPE_INT_RGB, as shown in this example. If you need to change the colors, you can use a LookupOp with a four-component LookupTable that adjusts the alpha component as required for BufferedImage.TYPE_3BYTE_BGR: "When data with non-opaque alpha is stored in an image of this type, the color data must be adjusted to a non-premultiplied form and the alpha discarded." Examples may be found in Using the Java 2D LookupOp Filter Class to Process Images and Image processing with Java 2D.

    0 讨论(0)
  • 2021-01-25 20:08

    See the the "pinkish" explanation here

    Basically the image is saved as a ARGB and most viewers interpret it as a CMYK. Alpha is preserved when opening it back in Java, though.

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