mrcodetastic / ESP32-HUB75-MatrixPanel-DMA

An Adafruit GFX Compatible Library for the ESP32, ESP32-S2, ESP32-S3 to drive HUB75 LED matrix panels using DMA for high refresh rates. Supports panel chaining.
MIT License
975 stars 215 forks source link

Banding/quantization visible - as if the colour depth is low #587

Closed tomduncalf closed 9 months ago

tomduncalf commented 9 months ago

Hey,

Great library! I am new to all this and just starting to play around, so it’s very possible I’m missing something obvious.

I’ve got a MatrixPortal S3 board and a Waveshare 64x64 panel, and I’m noticing some banding or “quantization”, especially visible with darker colours.

It’s hard to capture a photo of what I mean, but as an example, if I draw a gradient going from 0, 0, 0 to 32, 0, 0 (so dark reds) across the panel, I can see four distinct bands of colour, each approx 1/4 of the panel, rather than a smooth gradient. I’ve noticed this (I think) appearing as kind of square areas in brighter gradients, but the dark colour text shows it really clearly.

I was curious if this is just a limitation of the board or panel, or if there’s any way to increase the colour depth?

I’m using the library from the Arduino library manager so I assume it is compiled with the default 8 bits per colour, which should mean there’s no need for quantization as I understand it, but I’m happy to experiment with compiling it differently etc. I noticed the same thing occurs with CircuitPython, but that is limited to max. 6 bit colour so that might make more sense.

Interested to learn more!

Thanks, Tom

tomduncalf commented 9 months ago

This was a colour bit depth issue, I worked out how to change the bit depth and the problem goes away at higher depths.

For future reference, I did this by setting the depth before including the header:

#define PIXEL_COLOR_DEPTH_BITS 12
#include <ESP32-HUB75-MatrixPanel-I2S-DMA.h>