Page 1 of 1
How to use imageMagick to open a yuv image
Posted: 2014-01-16T14:50:00-07:00
by michaels
Hi,
I am running ImageMagick on ubuntu.
How can I use it to optn a yuv image?
I tried:
display ~/Downloads/tulips_yuv422_inter_planar_qcif.yuv
display: must specify image size `~/Downloads/tulips_yuv422_inter_planar_qcif.yuv' @ error/yuv.c/ReadYUVImage/145.
How can I find out the size of a yuv image? Can the tool detect it?
Thank you.
Re: How to use imageMagick to open a yuv image
Posted: 2014-01-16T15:24:58-07:00
by fmw42
Sounds like you have a raw image in some yuv colorspace. With raw images, you need to know the image dimensions to be able to read it into IM, since there is no header with that information in the file. Then you will need to tell IM that the data is yuv, using -set colorspace YUV.
see
http://www.imagemagick.org/Usage/formats/#rgb
Re: How to use imageMagick to open a yuv image
Posted: 2014-01-16T17:39:35-07:00
by michaels
Thanks. I get the image "tulips_yuv422_inter_planar_qcif.yuv " from
http://www.sunrayimage.com/examples.html.
I find out the image is All in qcif format, 176x144.
so I tried using IM by "display -size 176x144 -colorspace YUV tulips_yuv422_inter_planar_qcif.yuv "
It seems to me the 'red' part of the image is being duplicate by 4.
I don't know what the image supposed to look like so i am guess here.
I have been looking for a YUV 422 sample image, this is the only place I find from google.
If there is a better example, please let me know .
Thanks in advance.
Re: How to use imageMagick to open a yuv image
Posted: 2014-01-16T18:29:41-07:00
by fmw42
YUV 4:2:2 is typically a video format. See
http://www.fourcc.org/yuv.php
It is also from frame grabbers. See
http://www.sensoray.com/support/appnote ... _modes.htm
For your specific image, you need to know its format structure from Sunrayimage. See
http://www.sunrayimage.com/yuvformat.html
Tiff supports YUV 4:2:2, but is JPG compressed. You could likely write to that in IM from any input image.
See also any2yuv at
http://any2yuv.sourceforge.net/Docs
ffmpeg can apparently read and write YUV. See
http://www.ffmpeg.org/general.html#Image-Formats
I have really no experience with reading or writing to YUV. Perhaps one of the other IM users can help further.