-
Notifications
You must be signed in to change notification settings - Fork 43
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Always decode 3 or 4 channel PNG images.
The bug @HayesGordon ran into with Unity was because we were trying to decode grayscale images to a single-channel image and then expanding those to 4 channels as the Rive Renderer expects RGBA. That was padding missing channel data with 255, which is why we were getting Cyan (R would be read, GBA were filled with 255). Instead, we make the Bitmap library only work with RGB and RGBA and we let libpng do the expansion for us. Glorious: <img width="417" alt="CleanShot 2024-03-08 at 21 28 21@2x" src="https://github.com/rive-app/rive/assets/454182/326e537b-15ad-4914-acb7-a85ddc42c88c"> Diffs= 09feaccb0 Always decode 3 or 4 channel PNG images. (#6818) Co-authored-by: Luigi Rosso <[email protected]>
- Loading branch information
1 parent
ce2c740
commit 033a452
Showing
4 changed files
with
24 additions
and
36 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1 @@ | ||
7cb7eb8122d3625aad2c6032615006cc8f5383e8 | ||
09feaccb0c5bb3a2f88c23aca6c669d79eee4428 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -13,7 +13,6 @@ class Bitmap | |
public: | ||
enum class PixelFormat : uint8_t | ||
{ | ||
R, | ||
RGB, | ||
RGBA | ||
}; | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters