8000 [image][online_image][animation] Fix transparency in RGB565 by clydebarrow · Pull Request #7631 · esphome/esphome · GitHub
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content

[image][online_image][animation] Fix transparency in RGB565 #7631

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 10 commits into from
Oct 24, 2024

Conversation

clydebarrow
Copy link
Contributor
@clydebarrow clydebarrow commented Oct 19, 2024

What does this implement/fix?

When images were converted to RGB565 with transparency, especially from SVG, anti-aliasing was lost as the image format use chroma-keying instead of an alpha channel.

This PR changes the RGB565 with transparency format to one that has a proper alpha channel, so anti-aliasing works as expected.

Types of changes

  • Bugfix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to not work as expected)
  • Other

Related issue or feature (if applicable): fixes

Pull request in esphome-docs with documentation (if applicable): esphome/esphome-docs#

Test Environment

  • ESP32
  • ESP32 IDF
  • ESP8266
  • RP2040
  • BK72xx
  • RTL87xx
  • host

Example entry for config.yaml:

# Example config.yaml

Checklist:

  • The code change is tested and works locally.
  • Tests have been added to verify that the new code works (under tests/ folder).

If user exposed functionality or configuration variables are added/changed:

@probot-esphome
Copy link

Hey there @Syndlex, mind taking a look at this pull request as it has been labeled with an integration (animation) you are listed as a code owner for? Thanks!
(message by CodeOwnersMention)

@probot-esphome
Copy link

Hey there @guillempages, mind taking a look at this pull request as it has been labeled with an integration (online_image) you are listed as a code owner for? Thanks!
(message by CodeOwnersMention)

@codecov-commenter
Copy link
codecov-commenter commented Oct 19, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 54.00%. Comparing base (4d8b5ed) to head (6bdc1db).
Report is 1500 commits behind head on dev.

Additional details and impacted files
@@            Coverage Diff             @@
##              dev    #7631      +/-   ##
==========================================
+ Coverage   53.70%   54.00%   +0.29%     
==========================================
  Files          50       50              
  Lines        9408     9724     +316     
  Branches     1654     1348     -306     
==========================================
+ Hits         5053     5251     +198     
- Misses       4056     4147      +91     
- Partials      299      326      +27     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

Copy link
Contributor
@guillempages guillempages left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hm. I don't know why, but when testing this PR with an animation, the animation is now showing wrong.
Looks like there is something wrong with reading the pixels. (My animation is using RGB565 with transparency; maybe the drawing part of the animation also needs updating for the 3bytes per pixel somewhere?

Took a video: https://github.com/user-attachments/assets/232af92a-6b51-43ca-8dc2-eed7aaec9a21

Without the pr:
https://github.com/user-attachments/assets/199408d7-12ef-4ef3-9221-af625bc92340

(Ignore the cross/"HI" on the top left, that's a different issue (I hope))

@clydebarrow
Copy link
Contributor Author

maybe the drawing part of the animation also needs updating for the 3bytes per pixel somewhere?

More than likely. I did make some changes to animation, but didn't test it 🤔 I did test regular images and online images. Will do some testing and update.

@clydebarrow clydebarrow changed the title [image][lvgl][online_image] Fix transparency in RGB565 [image][online_image] Fix transparency in RGB565 Oct 22, 2024
@clydebarrow
Copy link
Contributor Author

but when testing this PR with an animation, the animation is now showing wrong.

Fixed now - the python code to convert the animated GIF needed updating too.

@clydebarrow clydebarrow changed the title [image][online_image] Fix transparency in RGB565 [image][online_image][animation] Fix transparency in RGB565 Oct 22, 2024
@clydebarrow clydebarrow added this to the 2024.11.0b1 milestone Oct 22, 2024
@jesserockz jesserockz merged commit 33fdbbe into esphome:dev Oct 24, 2024
27 checks passed
@github-actions github-actions bot locked and limited conversation to collaborators Oct 26, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants
0