BufferedImage colour change

前端 未结 2 1842
南旧
南旧 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.

提交回复
热议问题