Page 2 of 2

Re: How to use imageMagick to convert a ppm image to YUV422

Posted: 2014-01-20T18:47:40-07:00
by glennrp
There's no header so you need -size WxH and because Cb and Cv aren't recognized
as input formats you have to do something like

Code: Select all

mv Bretagne2.Cp temp.gray
convert -size WxH -resize 50% temp.gray ~/Downloads/Bretagne2-ds.Cb
mv Bretagne2.Cv temp.gray
convert -size WxH -resize 50% temp.gray ~/Downloads/Bretagne2-ds.Cv

Re: How to use imageMagick to convert a ppm image to YUV422

Posted: 2014-01-21T15:17:47-07:00
by michaels
Thanks. But I get an 'unexpected end of file error:
The original image Bretagne1.ppm from http://www.openjpeg.org/index.php?menu=samples. is 640X480.

Code: Select all

$ mv Bretagne2.Cb temp.gray
$ convert -size 640x480 -resize 50% temp.gray ~/Downloads/Bretagne2-ds.Cb
convert: unexpected end-of-file `temp.gray':  @ error/gray.c/ReadGRAYImage/205.

Re: How to use imageMagick to convert a ppm image to YUV422

Posted: 2014-01-21T16:08:57-07:00
by glennrp
michaels wrote:Thanks. But I get an 'unexpected end of file error:
The original image Bretagne1.ppm from http://www.openjpeg.org/index.php?menu=samples. is 640X480.

Code: Select all

$ mv Bretagne2.Cb temp.gray
$ convert -size 640x480 -resize 50% temp.gray ~/Downloads/Bretagne2-ds.Cb
convert: unexpected end-of-file `temp.gray':  @ error/gray.c/ReadGRAYImage/205.
You have to account for the downsampling while creating *.Cb and *.Cv; use -size 320x240 to read temp.gray.