Fred Weinhaus wrote:
> rgb: is a raw image format and not just a normal RGB set of color channels
>
> use -colorspace RGB to convert to RGB colorspace and any image type
> such as jpg, png, gif, tiff etc
>
Thanks for the info. (and s/convertion/conversion/ on previous mail)
Applying -colorspace as you suggested, I could step further, but one
problem remained.
(seemed to be byte-order disagreement)
I was going to:
yuv --(mplayer)-> ppm --(im)-> yuv'
and see how yuv and yuv' differed.
The original image, which was a 768x576 V4L2_PIX_FMT_YUYV frame,
looked like this:
$ od -Ax -tx1 -v 5110.yuv | grep ^000[0369cf]0
000000 10 80 10 80 10 80 10 80 10 80 10 80 10 80 10 80
000300 10 80 11 80 10 80 10 80 10 80 10 80 10 80 10 80
000600 5c 8b 72 73 74 90 77 74 7e 92 7d 76 76 92 6e 77
000900 fd 7f fd 7f fd 80 fd 7d fd 80 fd 7d fd 80 fd 7d
000c00 56 78 6f 7d 70 7b 73 7a 72 80 74 7a 72 82 72 7c
000f00 fd 80 fd 7d fd 7f fd 7f fd 80 fd 7f fd 80 fd 7e
Using mplayer, I converted it to a ppm:
$ mplayer -demuxer rawvideo -rawvideo w=768:h=576:yuy2 -vo pnm 5110.yuv
(produces auto-named 00000001.ppm, mv to 5110.ppm)
Then I "convert"ed the ppm to yuv.
$ convert -sampling-factor 4:2:2 5110.ppm -colorspace Rec601YCbCr 5110-im.yuv
It looked like this:
$ od -Ax -tx1 -v 5110-im.yuv | grep ^000[0369cf]0
000000 80 00 80 00 80 00 80 00 80 00 80 00 80 00 80 00
000300 80 00 80 00 80 00 80 00 80 00 80 00 80 00 80 00
000600 8d 57 71 71 91 74 72 77 94 7f 74 7e 94 76 76 6c
000900 80 ff 80 ff 80 ff 80 ff 80 ff 80 ff 80 ff 80 ff
000c00 77 51 7c 6e 7a 6f 79 72 7f 71 79 73 82 71 7b 71
000f00 80 ff 80 ff 80 ff 80 ff 80 ff 80 ff 80 ff 80 ff
Comparing hex dump of 5110{,-im}.yuv, I thought im put pixels in this way:
Cb Y Cr Y (or with Cb,Cr exchanged)
while I had
Y Cb Y Cr
(corresponding Cb and Cr seemed different, but that did not matter as much).
If I were to
'convert -size 768x576 -sampling-factor 4:2:2 5110.yuv -colorspace RGB
5110-im-expected.ppm',
how can I tell im I am feeding 'Y Cb Y Cr'?
(I '-list colorspace' but could not find something apropriate)
yu ning
_______________________________________________
Magick-users mailing list
[email protected]
http://studio.imagemagick.org/mailman/listinfo/magick-users