Non-square pixels support

Hi,

Couldn’t find any reference if LVGL supports displays with non-square pixels, like physical 16:9 aspect ratio with 800x480 resolution. Something like automatic font scaling, bitmaps and other stuff scaling could also be useful.

Regards,
Vas

2 Likes

Hi,

This feature is not supported, and to be honest I’ve never seen a display with non-square pixels so I don’t much about it :slight_smile:

Are there typical pixel aspect ratios?

I’ve heard that non-square pixels are quite popular in low-priced Android devices, but I just started to scratch the surface of the topic. I’ve bought ESP32-8048S043C (ESP32-8048S043 | macsbug) and am trying to figure out what to do now lol

It looks like non 1:1 PAR is not uncommon List of common resolutions - Wikipedia

Wow, it’s really unexpected. It seems the PAR can be any ratio.

I move this topic to the future request category. If it will interesting for more people we can figure out how to support it.

My LCD is 7 inch, 800 *480 ,but the arc is not normal.Does the LVGL can support for


non-square pixels lcd?

Yes, it seems.

Okay, we got traction on this topic :slight_smile:

You must avoid circles, it looks silly.
This display is very popular, because of good price.

1 Like

I have this issue many LCDs have non square pixels
Is there a temporary fix for this?

1 Like

There a re few complicated questions here:

  1. What to do with the rounded corners: LVGL need to draw ellipses (i.e. distorted circles)
  2. What to do with the fonts? If LVGL needs to transform them (i.e. +20% horizontal scale) it will be slow and ugly :frowning:
  3. What to do with the images? It might be ok to use pre-transformed images.

Pre-transforming images and fonts might need to be done twice, if supporting perpendicular display axis is needed(like 0/180 can be shared, but 90/270 cannot be shared with 0/180).

1 Like

If the Pixel Aspect Ratio(PAR) diverges too far from 1.0, anti-aliasing may need updated. For PAR<1.1, it might be close enough, but when I used a display with PAR=3, we had to fix anti-aliasing it to keep lines smooth.

Wow, it’s getting very complicated. Maybe it’s easier to render all these if a vector graphics GPU available . In this case we can define a constant matrix which distorts all drawing operations.

1 Like



most of the displays currently sold on Ali have this aspect ratio

Wow, good to know, thank you!

It seems really difficult to handle to be honest. Especially with good performance.