Report PNG encoding type (raw or indexed)
Closed this issue · 6 comments
24/32bit PNG files incorrectly reported as being 8-bits.
24/32bit PNG files incorrectly reported as being 8-bits.
Correctly, actually.
Because they are 8-bit, actually.
MediaInfo reports the bit depth per component and your "24-bit" files have 3 components (RGB), your "32-bit" files have 4 components (RGBA). A change between 24 and 32 is misleading about the bit depth of R G and B as they are 8-bit in both case (no color improvement).
It the past it was classic to report in total, but nowadays it is per component e.g. 10 in HDR10 means 10 bits per component, not in total, and it is also possible to have 32 bit per component (would be 128 if RGBA and as you expect).
At present 8bit and 24bit PNG's are reported as 'RGB 8bits' - which is not helpful and potentially confusing. For my use, total bits would tell me at a glance what I need to know.
At present 8bit and 24bit PNG's are reported as 'RGB 8bits'
Because both are 8 bits per component, so this MediaInfo line will always show 8 here (the reality). Total bit is 24 for both case, for the bit depth line.
The difference you are looking for is about how it is stored, directly as is ("true color", directly the 3x8-bit values stored before compression) or indexed/paletized (8-bit index pointing to up to 256 3x8-bit values, then index is stored before compression; remark that in both cases it is 3x8 = 24 bit for the color of the pixel), which would be on a different MediaInfo line.
we currently don't report this "format setting" but it is doable.
Looks like I don't have indexed/paletized PNG, only "true color", please share a sample file.
Storage information is relevant since users are expected to specify it. For example, Paint.net asks whether to store as 1, 2, 4, 8, 24 or 32 bits. It's these values that users understand and which Windows file explorer reports. Whether the indexed/palette mode deserves to be called "RBG" I'm not sure, but the result of MediaInfo using it led me to believe the application I was using was buggy - which I then reported.
Storage information is relevant since users are expected to specify it.
I already said that I agree with that.
aint.net asks whether to store as 1, 2, 4, 8, 24 or 32 bits. It's these values that users understand and which Windows file explorer reports.
Reminder, description of MediaInfo: "MediaInfo is a convenient unified display of the most relevant technical and tag data for video and audio files."
An important word is "unified", which means that we don't care about Paint.net or Microsoft wording, we provide technical information.
Again, 24-bit or 32-bit bit depth are not supported by PNG.
If you are convinced that it exists, please convince PNG specification authors because they explicitly list 16-bit as the maximal bit depth.
Some entities or people may write something not precise as a quick way to indicate a feature for a specific format, MediaInfo cares about being exact and not depending on a specific format.
Whether the indexed/palette mode deserves to be called "RBG"
You mix color space and packing format. We always talked about RGB color space, indexed/palette being permitted by spec only for (8-bit per component) RGB.
but the result of MediaInfo using it led me to believe the application I was using was buggy - which I then reported.
What you believe has no impact on what we report in MediaInfo because we don't want to adapt our report to what people believe, especially when different people believe in different beliefs.
We added the packing style in a line "Format settings", with "Linear" (--> truecolor or grayscale in PNG specs) or "Indexed-X" (with X = 1, 2, 4, 8) for PNG with palette.
We also fixed the bit depth info for 1, 2, 4 indexed PNG as we missed the wording in PNG spec that indexed PNG always provide 8-bit (x3 due to RGB) content
So you can now see the difference between your idea "24-bit" (bit depth is 8, colors space is RGBA, format settings are linear) your idea "24-bit" (bit depth is 8, colors space is RGB, format settings are linear) and your idea "8-bit" (bit depth is 8, colors space is RGB, format settings are indexed-8), and your idea "4-bit" (bit depth is 8, colors space is RGB, format settings are indexed-4), etc.
Windows dev snapshot.
Thanks for the changes. It wasn't "my idea" to reference PNG's as 8, 24, 32 bits etc. That decision was made by Microsoft and others - with which users can only comply.