On Mon, 2009-06-15 at 23:17 -0400, Anthony Thyssen wrote:
> On Mon, 15 Jun 2009 11:22:30 -0400
> John Koleszar <[email protected]> wrote:
>
> | Hi,
> |
> | I do a lot of work with raw YUV planar images, and the imagemagick suite
> | works great. I'm trying to find an option that would swap the chroma
> | planes when reading the file. ie, I have files that have the planes in
> | YVU (YV12) order, and would like to display/convert them with IM as I do
> | with YUV (I420) data. Any pointers?
> |
> -colorspace YUV -separate +swap -combine
>
> and your image will be in YVU space!
>
Thanks for the pointer, Anthony. It didn't work out of the box, but it
pointed me at the right options. Here's the command I ended up using:
$ convert -size 320x240 yuv:img.yv12 \
-separate -set colorspace YUV +swap -combine img.i420
Unfortunately, the two programs I use the most are 'display' and
'animate', and they don't accept those options. It looks like I can pipe
the output of convert to display, which works for single frame files.
But convert only seems to handle the first frame (with the yuv:
decoder). Is there an option to get it to handle the whole file? display
and animate accept multiple frames with yuv:. Actually, in addition,
there seems to be a bug with convert in this multiple-frame case:
$ cat img.yv12 img.yv12 > img-2.yv12
$ convert -size 320x240 yuv:img-2.yv12 \
-separate -set colorspace YUV +swap -combine yuv:img-2.i420
The chroma planes are no longer swapped in img-2.i420. The output
doesn't match the YV12 source exactly, but it's close:
$ psnr img.yv12 img.i420
16.293649
$ psnr img.yv12 img-2.i420
72.390724
(Sorry for not using imagemagick, but I can't get 'compare' to work with
raw yuv files)
Thanks for your help!
John
_______________________________________________
Magick-users mailing list
[email protected]
http://studio.imagemagick.org/mailman/listinfo/magick-users