PixelTypeInfo could use a BitsPerComponent property #1394
-
Currently the only method to determine the image bit-depth when using A BitsPerComponent property would allow callers to determine the image bit depth without any guesswork. This would simplify the case where a caller does not know in advance if the image is 8-bits-per-component or 16-bits-per-component. |
Beta Was this translation helpful? Give feedback.
Replies: 3 comments 9 replies
-
The idea behind the current API is that further information is obtainable upon demand. For example if you use. Image.Identify(stream, out IImageFormat detectedFormat) Then you can use the returned format to determine other format specific metadata. if (detectedFormat is PngFormat pngFormat)
{
PngMetadata pngMeta = imageInfo.Metadata.GetPngMetadata();
PngColorType? colorType = pngMeta.ColorType;
} You can then use that returned value to tell you whether the original pixel format contains an alpha component. |
Beta Was this translation helpful? Give feedback.
-
@0xC0000054 what do you do with the image after decoding it? Do you apply built-in processors like Resize, or do you need to access the pixel buffers manually ( Assuming the first case, if the (non generic) |
Beta Was this translation helpful? Give feedback.
-
@0xC0000054 V4 will have this information. We'll provide per component bit depth and ordering as well as color type metadata |
Beta Was this translation helpful? Give feedback.
The idea behind the current API is that further information is obtainable upon demand.
For example if you use.
Then you can use the returned format to determine other format specific metadata.
You can then use that returned value to tell you whether the original pixel format contains an alpha component.