4 bpp PNGs not supported: Unexpected colourType: 3
See original GitHub issueWould be great if this package supported more color types, including 4 bits per pixel in PNGs.
Currently I get this error when loading such images in Node:
> (node:11512) UnhandledPromiseRejectionWarning: Error: Unexpected colourType: 3
at loadPNG (image-js/lib/image/core/load.js:123:13)
at loadBinary (image-js/lib/image/core/load.js:66:16)
at binaryDataP.then.binaryData (/image-js/lib/image/core/load.js:95:12)
Example 4 bpp image:
Issue Analytics
- State:
- Created 5 years ago
- Comments:5 (3 by maintainers)
Top Results From Across the Web
PNG (Portable Network Graphics) Specification - W3C
Source data with a precision not directly supported in PNG (for example, ... bpp is equal to 1 (rounding up); for color type...
Read more >Cannot load 48 bpp PNG (Bit depth is not supported or not valid)
Prerequisites. I have written a descriptive issue title; I have verified that I am running the latest version of ImageSharp
Read more >lodepng.h
The colortype and bitdepth of the output PNG image cannot be chosen, they are automatically determined ... The palette is only supported for...
Read more >Chapter 8, "PNG Basics" - libpng.org
Palette-based images, also known as colormapped or index-color images, use the PLTE chunk and are supported in four pixel depths: 1, 2, 4,...
Read more >error.rs.html -- source - Docs.rs
Something that doesn't happen in a normal, well encoded, PNG image. ... 42 => "tRNS chunk appeared while it was not allowed for...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
Yes, it works great, thanks!
This should be fixed in version 0.21.1 (commit). I added a test with your image and another one with a palette saved from Photoshop.