views:

332

answers:

2

Please let me know how to convert a JPG/PNG/BMP image into a 8-bit grayscale RAW image in Java. Is it possible to obtain using ImageIO API?

+1  A: 

You will find an example here

stacker
+1 Good example, but it converts to the same bit depth as the original.
trashgod
+1  A: 

You can convert an image to 8-bit grayscale using ColorConvertOp with a BufferedImage.TYPE_BYTE_GRAY as the filter() destination. Here's an example.

RAW is actually a family of vendor-defined image formats, many of which can be read with jrawio. Once converted, you might be able to write with ExifTool.

trashgod