How to convert a 4-bit LCD image

Important: unclear posts may not receive useful answers.

Before posting

  • Get familiar with Markdown to format and structure your post
  • Be sure to update lvgl from the latest version from the master branch.
  • Be sure you have checked the FAQ and read the relevant part of the documentation.
  • If applicable use the Simulator to eliminate hardware related issues.

Delete this section if you read and applied the mentioned points.


What MCU/Processor/Board and compiler are you using?

What LVGL version are you using?

What do you want to achieve?

The LCD I’m using can only display the lower 4 bits of the image. However, the lvgl image online converter site converts images into 8-bit. The desired image cannot be displayed because the top 4 bit values are not displayed. Is there a solution?

What have you tried so far?

Code to reproduce

Add a code snippet which can run in the simulator. It should contain only the relevant code that compiles without errors when separated from your main code base.

The code block(s) should be formatted like:

/*You code here*/

Screenshot and/or video

If possible, add screenshots and/or videos about the current state.

Can you use the ALPHA_4BIT image format?

It wasn’t effective and nothing was displayed. The results were the same when using LV_IMG_CF_INDEXED_4BIT and when using LV_IMG_CF_TRUE_COLOR_ALPHA.

Note that LVGL doesn’t support 4bit format directly. Probably you need to use a set_px_cb.

when i using set_px_cb, pixel is broken