We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
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
DEBUG
RELEASE
4.0.0-alpha.0.18+1ec479e404455608db862b4d607207b4bf2063c1
SixLabors.ImageSharp.Drawing,3.0.0-alpha.0.1+316fb2e528e2fd131a22f4d05a9dfdc4d908dbcc
Win11 24h2
.net8.0
We have 4bit bmp files and during parsing, ImageSharp produces wrong palette metadata for it.
result = {ReadOnlyMemory<Color>} System.ReadOnlyMemory<Color>[21] [0] = {Color} 000000FF [1] = {Color} 111100FF [2] = {Color} 220011FF [3] = {Color} 002222FF [4] = {Color} 333333FF [5] = {Color} 444400FF [6] = {Color} 550044FF [7] = {Color} 005555FF [8] = {Color} 666666FF [9] = {Color} 777700FF [10] = {Color} 880077FF [11] = {Color} 008888FF [12] = {Color} 999999FF [13] = {Color} AAAA00FF [14] = {Color} BB00AAFF [15] = {Color} 00BBBBFF [16] = {Color} CCCCCCFF [17] = {Color} DDDD00FF [18] = {Color} EE00DDFF [19] = {Color} 00EEEEFF [20] = {Color} FFFFFFFF
but actual palette is just steps of gray, starting from 111111 to FFFFFF Actual on-disk-values of bmp file
FWIW image itself is parsed correctly.
var image = Image.Load<Rgb24>("1.0.bmp"); var colorTable = image.Metadata.GetBmpMetadata().ColorTable.GetValueOrDefault();
Observe values of colorTable.
1.0.bmp.zip
The text was updated successfully, but these errors were encountered:
Similar issue is with 8bit indexed images, also colors are shifted to one byte
Sorry, something went wrong.
Looks like issue is here:
ImageSharp/src/ImageSharp/Formats/Bmp/BmpDecoderCore.cs
Line 1600 in e20e47f
Thanks for the additional detective work. I'll have a look ASAP.
No branches or pull requests
Prerequisites
DEBUG
andRELEASE
modeImageSharp version
4.0.0-alpha.0.18+1ec479e404455608db862b4d607207b4bf2063c1
Other ImageSharp packages and versions
SixLabors.ImageSharp.Drawing,3.0.0-alpha.0.1+316fb2e528e2fd131a22f4d05a9dfdc4d908dbcc
Environment (Operating system, version and so on)
Win11 24h2
.NET Framework version
.net8.0
Description
We have 4bit bmp files and during parsing, ImageSharp produces wrong palette metadata for it.
but actual palette is just steps of gray, starting from

111111 to FFFFFF
Actual on-disk-values of bmp file
FWIW image itself is parsed correctly.
Steps to Reproduce
Observe values of colorTable.
Images
1.0.bmp.zip
The text was updated successfully, but these errors were encountered: