Search code examples
bufferedimagejcodec

JCodec Picture to BufferedImage


I am new to JCodec, but I am attempting to convert a JCodec Picture to a BufferedImage. Unfortunately, the methods to do so in JCodec have been deprecated, save for those methods converting a Picture to a Picture8Bit. However, I haven't found a JCodec method for the conversion of a Picture to a Picture8Bit.


Solution

  • The classes FrameGrab and Picture are all deprecated, that is why also all methods using Picture is deprecated in AWTUtil.

    Instead, use the class FrameGrab8Bit, where the getNativeFrame() method will return a Picture8Bit. Then you can easily use all the non-deprecated methods of AWTUtil.