-
Notifications
You must be signed in to change notification settings - Fork 131
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
PNG's are stored in RGB order but Wuffs returns BGR/BGRA? #141
Comments
Technically, yes, but:
On the other hand, Wuffs' standard library isn't just a PNG decoder. It can decode multiple image file formats (all with the same API) and it's simpler for the API caller if Wuffs standardizes on one order (independent of the actual file format) and we've chosen the one that Win32-x86 uses: BGRA. |
nigeltao
added a commit
that referenced
this issue
Mar 27, 2024
PNG (as a source pixel format) is RGB or RGBA order. Wuffs' std/png benchmarks, like the other image formats, decode to BGRA order. *If* those benchmarks are altered to target RGBA instead, we get: name old speed new speed delta wuffs_png_decode_image_40k_24bpp/clang14 279MB/s ± 0% 293MB/s ± 0% +5.11% (p=0.008 n=5+5) wuffs_png_decode_image_4002k_24bpp/clang14 289MB/s ± 0% 303MB/s ± 0% +4.89% (p=0.008 n=5+5) wuffs_png_decode_image_40k_24bpp/gcc12 311MB/s ± 0% 332MB/s ± 0% +6.84% (p=0.008 n=5+5) wuffs_png_decode_image_4002k_24bpp/gcc12 325MB/s ± 0% 339MB/s ± 0% +4.49% (p=0.008 n=5+5) When starting from 3-channel RGB, ending with RGBA is now as fast as ending with BGRA. Updates #141
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
According to the PNG spec: Pixels are always stored in RGBA order:
However Wuffs reports the pixel format as BGR(A).
Am I missing something here or is performance lost by swizzling? 😯
The text was updated successfully, but these errors were encountered: