how to display raw rgb32 image?

Questions and postings pertaining to the usage of ImageMagick regardless of the interface. This includes the command-line utilities, as well as the C and C++ APIs. Usage questions are like "How do I use ImageMagick to create drop shadows?".
Post Reply
davemilter
Posts: 2
Joined: 2018-01-22T14:09:34-07:00
Authentication code: 1152

how to display raw rgb32 image?

Post 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.
snibgo
Posts: 12159
Joined: 2010-01-23T23:01:33-07:00
Authentication code: 1151
Location: England, UK

Re: how to display raw rgb32 image?

Post 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
snibgo's IM pages: im.snibgo.com
davemilter
Posts: 2
Joined: 2018-01-22T14:09:34-07:00
Authentication code: 1152

Re: how to display raw rgb32 image?

Post 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
Post Reply