adafruit / adafruit/Adafruit_CircuitPython_RGB_Display
HX8357: Mirroring and Color issues
- Dominant language
- Python
- Stars
- 143
- Forks
- 53
- PR merge metrics
- No merged PRs in 30d
Description
If I just use the library as it is, my displays (HX8357d) have two issues:
- The displayed image is mirrored X <-> Y
- The colors seems kind of inverted (or maybe better just BGR instead of RGB
I tried the following:
https://github.com/adafruit/Adafruit_CircuitPython_RGB_Display/blob/2c4d380e552a2cd560e36a500f6ac3f51c8085b0/adafruit_rgb_display/hx8357.py#L96
I changed `(_MADCTL, b"\xa0")` to `(_MADCTL, b"\x20")`
This fixes the mirroring of the image.
But the colors are still behaving odd. Some JPG images are displayed correct (does this make any sense?). But most (PNG and JPG) look inverted (except white and black). Also, if I draw text, the colors are displayed in BGR instead of RGB. Any idea how I could adapt the library to fix this as well?
```
(_COLMOD, b"\x55"), # 16 bit
(_MADCTL, b"\xc0"),
(_TEON, b"\x00"),
(_TEARLINE, b"\x00\x02"), # TW off
(_SLPOUT, None),
(_MADCTL, b"\x20"),
(_DISPON, None),
```
Contributor guide
No contributing guide indexed for this repository
Research direction
Start in adafruit_rgb_display/hx8357.py around the MADCTL initialization referenced in the issue, then reproduce the report with an HX8357d display using the shown initialization values. Check orientation and RGB/BGR rendering with text and representative PNG and JPG images; done means both mirroring and color behavior are correct.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- python
- Domain
- embedded-iot
- Issue type
- Bug
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 35/100