Skip to content

PixelTypeInfo could use a BitsPerComponent property #1394

Discussion options

You must be logged in to vote

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.

Replies: 3 comments 9 replies

Comment options

You must be logged in to vote
9 replies
@0xC0000054
Comment options

@antonfirsov
Comment options

@JimBobSquarePants
Comment options

@antonfirsov
Comment options

@JimBobSquarePants
Comment options

Answer selected by 0xC0000054
Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
0 replies
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Ideas
Labels
None yet
3 participants