How to Correct Inverted Colors When Converting Framebuffer Data to PNG with ImageMagick on OMAP35x?

I'm trying to convert raw framebuffer data /dev/fb0 on my OMAP35x board to a PNG image using ImageMagick's convert command. However, the resulting image screen.png appears incorrect. The The colors in the image are completely reversed, with negative values displayed. Here is the command I used:
convert -depth 8 -size 240x320 rgb:./screen.raw -swap 0,2 -separate -combine screen.png
convert -depth 8 -size 240x320 rgb:./screen.raw -swap 0,2 -separate -combine screen.png
I've verified that the framebuffer resolution is indeed 240x320 pixels. Is there an error in my convert command flags for capturing the framebuffer data with ImageMagick? Are there any specific considerations for handling framebuffer data on OMAP35x boards that might cause inverted colors during conversion? @Middleware & OS
2 Replies
Dtynin
Dtynin5mo ago
@Sterling This challenge could possibly be from the way ImageMagick interprets the raw framebuffer data and the byte order used by the OMAP35x, try adding the -endian flag, specifying either "lab" or "msb" for little or big endian based on your OMAP35x structure.
Sterling
Sterling5mo ago
Alright @Dtynin I will try this out
Want results from more Discord servers?
Add your server