ImageInfo Class
A snapshot of the information that can be determined about an encoded image without decoding its pixels.
public sealed class ImageInfoRemarks
Instances are produced by Image.Identify and by ImageReader<TPixel>.Info. Values that cannot be determined from the examined part of the file are null; they are never guessed. In ImageIdentifyMode.Header mode, the frame count of a GIF file, for instance, is unknown.
ImageInfo.Metadata and ImageInfo.Animation are detached copies owned by this instance: modifying them does not affect any image, reader, or other ImageInfo.
Properties
| Name | Description |
|---|---|
| Animation | Gets the animation-wide information (such as the number of plays), or null if the file is not known to be animated. |
| BitsPerComponent | Gets the precision of the encoded samples, in bits per component (for example 1, 2, 4, 8 or 16 for PNG; 8, 10 or 12 for AVIF; 8 to 12 for HEIC; 1 to 16 for JPEG XL and JPEG 2000; 16, 24 or 32 for the floating-point samples of TIFF, whose ImageInfo.PixelFormat is PixelFormat.RgbaHalf or PixelFormat.RgbaFloat; 16 (HALF) or 32 (FLOAT or UINT) for OpenEXR). |
| CollectionEntryCount | Gets the number of entries of a multi-entry container (the pages of a TIFF document, the representations of an icon), or null for a single-image format or when the examined part of the file does not say. |
| ColorModel | Gets the color model of the encoded samples. |
| Format | Gets the detected encoded format. |
| FrameCount | Gets the number of displayed animation frames (excluding a separate poster frame), or null when unknown. |
| HasPosterFrame | Gets a value indicating whether the file contains a separate poster frame (APNG default image that is not part of the animation), or null when unknown. |
| Height | Gets the canvas height, in pixels. |
| IdentifyMode | Gets the mode used to produce this snapshot. |
| IsAnimated | Gets a value indicating whether the file is an animation, or null when unknown. |
| MayHaveTransparency | Gets a value indicating whether the encoding is capable of producing non-opaque pixels (alpha channel, transparency chunk, or transparent palette index), or null when unknown. This is not the result of a pixel scan. |
| Metadata | Gets the metadata found in the examined part of the file. |
| PixelFormat | Gets the pixel format that the untyped Image.Load overloads produce for this file (the default working representation). |
| Size | Gets the canvas size, in pixels. |
| Width | Gets the canvas width, in pixels. |
Animation
ImageInfo.csGets the animation-wide information (such as the number of plays), or null if the file is not known to be animated.
public AnimationMetadata? Animation { get; }Property value
BitsPerComponent
ImageInfo.csGets the precision of the encoded samples, in bits per component (for example 1, 2, 4, 8 or 16 for PNG; 8, 10 or 12 for AVIF; 8 to 12 for HEIC; 1 to 16 for JPEG XL and JPEG 2000; 16, 24 or 32 for the floating-point samples of TIFF, whose ImageInfo.PixelFormat is PixelFormat.RgbaHalf or PixelFormat.RgbaFloat; 16 (HALF) or 32 (FLOAT or UINT) for OpenEXR).
public int BitsPerComponent { get; }Property value
CollectionEntryCount
ImageInfo.csGets the number of entries of a multi-entry container (the pages of a TIFF document, the representations of an icon), or null for a single-image format or when the examined part of the file does not say.
public int? CollectionEntryCount { get; }Property value
Remarks
Entries are never animation frames: ImageInfo.FrameCount describes the image this snapshot is about (the first page, or the default representation) and stays 1. Use ImageCollection to reach the other entries.
ColorModel
ImageInfo.csGets the color model of the encoded samples.
public ImageColorModel ColorModel { get; }Property value
Format
ImageInfo.csFrameCount
ImageInfo.csHasPosterFrame
ImageInfo.csHeight
ImageInfo.csIdentifyMode
ImageInfo.csGets the mode used to produce this snapshot.
public ImageIdentifyMode IdentifyMode { get; }Property value
IsAnimated
ImageInfo.csMayHaveTransparency
ImageInfo.csMetadata
ImageInfo.csGets the metadata found in the examined part of the file.
public ImageMetadata Metadata { get; }Property value
PixelFormat
ImageInfo.csGets the pixel format that the untyped Image.Load overloads produce for this file (the default working representation).
public PixelFormat PixelFormat { get; }