esphome / esphome/feature-requests
Display Image Run-Length encoding
- Dominant language
- No language data
- Stars
- 450
- Forks
- 29
- PR merge metrics
- No merged PRs in 30d
Description
**Describe the problem you have/What new integration you would like**
Run-Length encoding for Display Images
**Please describe your use case for this integration and alternatives you've tried:**
Display Images take a lot of firmware size (often 30kb even for small images)
Especially for binary images (pixel ON/OFF) run-length encoding can shrink that down a lot.
**Additional context**
I've been comparing and coming up with a bunch of potential solutions to this problem.
So far, the best result I've achieved is by using elias-gamma encoding.
- 1st Bit denotes pixel value of first pixel
- After that, integers are encoded in elias-gamma format that denote how long the given bit is repeated. The next integer shows how many bits in sequence are the inverse of that, etc
For structured data (material design icon, esphome log) this achieves compression rates of 5-6. It can be further improved by using different curves (spiral etc) for the pixel walk, but only a bit.
On random data, it's of course worse (around 40% bigger) - if this shows up in real-world circumstances, we might want to use an abstract class with different encoding types.
Contributor guide
No contributing guide indexed for this repository
Research direction
No repository files, tests, or entry points are named. Start by locating the Display Image implementation and assessing how image data is stored in firmware; then define the encoding integration, behavior for unsuitable image data, and validation criteria for the reported size reduction.
Written by the indexing model from the issue text.
Assessment
- Domain
- embedded-iot
- Issue type
- Feature
- Difficulty
- 5/5
- Estimated time
- Over a week
- Activity status
- Stale
- Clarity
- Needs clarification
- Newbie friendliness
- 20/100