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

Please add BMP with 64bpp #21

Closed
Fojtik opened this issue Sep 20, 2023 · 12 comments
Closed

Please add BMP with 64bpp #21

Fojtik opened this issue Sep 20, 2023 · 12 comments

Comments

@Fojtik
Copy link

Fojtik commented Sep 20, 2023

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
Copy link
Owner

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
Copy link
Author

Fojtik commented Sep 29, 2023

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:
#17

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

@Fojtik
Copy link
Author

Fojtik commented Sep 30, 2023

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
Copy link
Owner

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

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
Copy link

pkasting commented Nov 1, 2023

Can be closed?

@Fojtik
Copy link
Author

Fojtik commented Nov 1, 2023

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
Copy link
Owner

jsummers commented Nov 2, 2023

rgb64.zip

@Fojtik
Copy link
Author

Fojtik commented Nov 2, 2023

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
Copy link
Owner

jsummers commented Nov 3, 2023

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
Copy link
Author

Fojtik commented Nov 5, 2023

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
Copy link
Owner

jsummers commented Nov 5, 2023

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
Copy link
Owner

Resolved in v2.8.

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

3 participants