Skip to content
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

Color format #296

Open
nyovaya opened this issue May 30, 2021 · 4 comments
Open

Color format #296

nyovaya opened this issue May 30, 2021 · 4 comments

Comments

@nyovaya
Copy link

nyovaya commented May 30, 2021

In which concrete color format does this library decode to?

for RGB is it: RGB or BGR?
or for RGBA is it: ARGB, ABGR, RGBA or BGRA?

Or is it specified by the png documentation?

Also Im using ARGB in my application as another library requires it - is there some crate(of this organisation or some other) which allows me convert the RGBA/RGB(any order) data to ARGB?

@fintelia
Copy link
Contributor

It decodes to RGB or RGBA. If you want to convert to a different order, just iterate over the output data pixel by pixel and permute the channels.

@parasyte
Copy link

Semi-related: Perhaps it would be nice to support cint for color interoperability with other crates?

@HeroicKatora
Copy link
Member

It would but the crate needs to go 1.0 for this to really be considerably better. An unstable compatibility crate makes little to no sense because it necessarily ends up getting stuck on a particular major version in order to fulfill its primary objective. For example, see rgb which is 0.8 for three years now for precisely this reason. This was also a motivation to choose bytemuck over other transmutation crates, even though it isn't (yet) in the interface.

@fintelia
Copy link
Contributor

We'd also have to figure out exactly what supporting cint meant. I'm not convinced their interface matches what we'd need.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants