How to do a framebuffer screenshot

I’ll explain how to do framebuffer screenshots on 16-bit and 32-bit framebuffer. For 16-bit this is fully based on

Capturing screenshots

Whatever the bit-depth of your framebuffer, the first step is to capture the frambuffer raw data on the board:

Now the you need to take the raw image, and convert it to a standard image format. This step depends on what type of display is there

Converting 16-bit Framebuffer screenshot (RGB565) into png

To convert the raw rgb data extracted from /dev/fb0, use iraw2png perl script

To do the conversion, type the following command in the host:

where 640 and 480 are respectively the width and height of your framebuffer.

This has been tried on a 16-bit framebuffer on EM8620 series.

Converting 32-bit Framebuffer screenshot (ARGB, RGBA, BGRA…) into png

The solution proposed here is not as neat as the blackfin’s solution for 16-bit framebuffer, however this still works.

First you’ll need to install Gimp 2 in your computer (Linux or Windows).

Then open the screenshot as a raw file (Select File Type: Raw Image Data) in Gimp2, enter the width and height as well of the color arrangement, RGB, RGBA etc…

If the image looks OK, but the colors do not match, then that probably because the R (red), G (Green), B(Blue) and A (Alpha) fields are mixed up. You’ll just need to use the Channel Mixer to re-arrange or permute the colors. (e.g. RGBA -> BGRA). To get to that menu click on Colours->Components->Channel Mixer and there you’ll be able to set the Red channel to Blue and the Blue Channel to Red or whatever settings required to get the right colors.

Finally simply save this file as PNG or any format you like.

Share this:

Support CNX Software! Donate via cryptocurrencies or become a Patron on Patreon

ROCK Pi 4C Plus
Notify of
The comment form collects your name, email and content to allow us keep track of the comments placed on the website. Please read and accept our website Terms and Privacy Policy to post a comment.
Weller PCB manufacturer