jsummers / bmpsuite

A set of Windows BMP image files, for testing purposes
https://entropymine.com/jason/bmpsuite/
GNU General Public License v3.0
56 stars 16 forks source link

Please add BMP with 64bpp #21

Closed Fojtik closed 10 months ago

Fojtik commented 1 year ago

BMP with 64bpp is now legal: https://en.wikipedia.org/wiki/BMP_file_format

In the original OS/2 DIB, the only four legal values of color depth were 1, 4, 8, and 24 bits per pixel (bpp).[5] Contemporary DIB Headers allow pixel formats with 1, 2, 4, 8, 16, 24 and 32 bits per pixel (bpp).[19] GDI+ also permits 64 bits per pixel.[20]

jsummers commented 1 year ago

I'd like to do that, but I'd need a way to validate the correctness of my file.

Is there any free software, or component of Windows, that supports 64-bit BMP files, and that we can be confident does so correctly? I haven't researched this recently, so maybe the situation has improved.

Fojtik commented 1 year ago

ValidatedImage I really do not know. I wish to add support to the graphics magick http://www.graphicsmagick.org/ But even when I add a support It will not be a solid reference.

This seems to be a good starting point, because windows itself can read this file and create a correct icon: https://github.com/jsummers/bmpsuite/issues/17

So we can create image and validate it through Windows program manager.

Fojtik commented 1 year ago

https://stackoverflow.com/questions/20778227/get-64bpp-image-color Quote: outputLevel = 8192 * Math.Pow(inputLevel / 255d, 1d / gamma) which gives you 1770 for inputLevel = 128 and gamma = 0.45

This is not a classic 16bpp.


Graphics magick can now read these files with 64bpp. I can generate installation for you if you ask for it,.

O:\temp\29\rgb64>gm identify argb64.bmp
argb64.bmp BMP 127x64+0+0 DirectClass 8-bit 63.6Ki 0.000u 0m:0.000236s
O:\temp\29\rgb64>gm convert argb64.bmp argb64.png

And see the result: argb64

jsummers commented 11 months ago

I've added a simple 64-bit image (commit 8420c57bfb).

I might replace it with one that has transparency. There are probably lots of other things that could be tested with respect to these advanced images, but I'm thinking that's beyond the scope of what I want for BMP Suite.

pkasting commented 11 months ago

Can be closed?

Fojtik commented 11 months ago

If you add a sample of this type just close it. I do not have time to check image yet. You probably change only C code BMP generator.

jsummers commented 11 months ago

rgb64.zip

Fojtik commented 11 months ago

OK thanks.

O:\temp\30>gm convert rgb64.bmp rgb64.pcx works

O:\temp\30>gm identify rgb64.bmp rgb64.bmp BMP 127x64+0+0 DirectClass 8-bit 63.6Ki 0.000u 0m:0.000009s works

jsummers commented 11 months ago

As far as I can tell, there nothing weird about how transparency works. So I'll probably replace the 64-bit test image with this one:

rgba64.zip

(expected to be rendered like html/rgba32.png)

Fojtik commented 11 months ago

It seems to me that your previous image is deffective. It contains pixel values bigger than 8192. I really do not know, I have put hardlimit 8191.

For 64bpp the opacity channel is already present. I do not know about any switch inside BMP header that turns it off. It would be interesting whether format 48bpp also exists without opacity channel.

jsummers commented 11 months ago

Unless I'm mistaken, the rgba64 image has no sample values outside the range 0 to 8192 inclusive.

The WIC Native Pixel Formats document, "Fixed-Point Numerical Encoding" section, says the normal maximum is 8192, not 8191, and I assume that applies to this format.

(I also wonder about variations like 48-bit RGB, but at this point I'm not planning to investigate.)

jsummers commented 10 months ago

Resolved in v2.8.