Take the 2-minute tour ×
Ask Ubuntu is a question and answer site for Ubuntu users and developers. It's 100% free, no registration required.

how can I display a yuv image on ubuntu? I have installed "Image Magick" on ubuntu, but when I try it, it said I must specify image size:

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.

But I don't know the image size, can program detect that for me?

Thank you.

share|improve this question

1 Answer 1

No, the program can not detect the size of an image with no header.

You have just the pixel data, the information whether 200 pixels are a 10x20 image, or a 20x10 image, is just not in the file.

What you can do is finding out how many pixels the image has, and try formats that make sense, trying the ones first that are common or are expected with your use case.

What you know about the size is
pixelcount = width x height

You could also just try a series of formats that are possible in terms of pixels = width x height, and look at them wheter they make sense as an image of the kind you expect. That does not work in the general case, but should work in practice.

share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.