Page 1 of 1

how to display raw rgb32 image?

Posted: 2018-01-22T14:15:09-07:00
by davemilter
I want display image with such format:

>The image is stored using a 32-bit RGB format (0xffRRGGBB).

4 bytes per pixel 600 pixel per row, 600 rows.

I tried this:

Code: Select all

display -size 600x600 -depth 8  RGBO:/tmp/image.data
display -size 600x600 -depth 32  RGBO:/tmp/image.data
But didn't see suitable picture.

Re: how to display raw rgb32 image?

Posted: 2018-01-22T15:00:09-07:00
by snibgo
I expect this will work:

Code: Select all

convert -size 600x600 -depth 8 RGBA:in.bin out.png
But this puts values in the wrong channels, so you will need to discard the last channel:

Code: Select all

convert -size 600x600 -depth 8 RGBA:in.bin -channel RGBA -separate -delete 0 -combine out2.png

Re: how to display raw rgb32 image?

Posted: 2018-01-22T15:10:45-07:00
by davemilter
Thank you, snibgo.

This one works as expected:

Code: Select all

convert -size 600x600 -depth 8 BGRA:image.data -channel BGRA -separate -delete 3 -combine out2.bmp