Decoding a JPG to readable YCbCr hex data
Posted: 2017-05-31T09:05:05-07:00
Hi,
I'm trying to verify a JPEG Codec, and running into the following problem: I ultimately need to decode the original .jpg image and convert the output to some sort of readable YCC data.
First, I attempted to use the open source djpeg, but whether I'm outputting .bmp, .gif, et al, it's always in the RGB colorspace.
Next, I used ImageMagick to convert the .jpg straight to a .miff file in the YCbCr colorspace:
% convert -colorspace ycbcr testImage.jpg testImage.miff
The output (.miff file) identifies as YCC, but how can I actually extract the image data from this file?
I attempted to use the following to make it more readable:
% xxd -i testImage.miff testImage_miff.txt
However, I don't know how to parse through the header information like I normally would with a .jpg or .bmp file.
Thanks for your help!
I'm trying to verify a JPEG Codec, and running into the following problem: I ultimately need to decode the original .jpg image and convert the output to some sort of readable YCC data.
First, I attempted to use the open source djpeg, but whether I'm outputting .bmp, .gif, et al, it's always in the RGB colorspace.
Next, I used ImageMagick to convert the .jpg straight to a .miff file in the YCbCr colorspace:
% convert -colorspace ycbcr testImage.jpg testImage.miff
The output (.miff file) identifies as YCC, but how can I actually extract the image data from this file?
I attempted to use the following to make it more readable:
% xxd -i testImage.miff testImage_miff.txt
However, I don't know how to parse through the header information like I normally would with a .jpg or .bmp file.
Thanks for your help!