6

I've created a minimal Linux system which boots to the console and does not contain any kind of graphical environment.

I now want to display an image file from my C program or a bash script on the screen.

How can I do this?

3
  • have you gone through LFS , BLFS projects? Commented Sep 2, 2016 at 11:17
  • 2
    If your system has a framebuffer device, there's the fbv utility for JPEG, GIF and PNG images. See free-electrons.com/blog/super-fast-linux-splashscreen Commented Sep 3, 2016 at 9:05
  • Thanks a lot! The /dev/fb0 works really well. Commented Sep 3, 2016 at 10:27

2 Answers 2

5

If your system has a framebuffer device, i.e. /dev/fb0, then there's the fbv framebuffer viewer utility for JPEG, GIF, PNG, and BMP images. (It's available as a target package in Buildroot.)
And if you have a suitable raw image (e.g. a framebuffer capture), then that file can be written directly to the framebuffer device.
See Super fast Linux splashscreen for more details.

Sign up to request clarification or add additional context in comments.

Comments

1

There are a few options.

  • If you have no “graphics” hardware, per se, you can use something like libaa or libcaca to convert an image into “ASCII ART.”
  • If you have PC-type VGA-type hardware available (at least), you can use something like svgalib to write to the hardware, eg, using zgv
  • If your device has a video framebuffer, you can write directly to the framebuffer device, as well.

Comments

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.