An image: an image XObject, an inline image, or the mask or alternate of one. A live view over the image dictionary that reads its entries with their defaults and decodes its samples on request.
public sealed class PdfImage
ISO 32000-2 §8.9. Get one with GetImage(CosObject?), GetImage(String) or, for an inline image in a
content stream, GetInlineImage(in ContentOperator). Every property reads the dictionary on every call.
Deviations are repaired the way most readers repair them and recorded as diagnostics on the document (a property of an image that
cannot be painted at all, such as one without a width, reads as 0 or null); in strict mode the first deviation
throws from the member that meets it.
Decode() returns the samples in the §8.9.3 layout as a DecodedImage; the Decode array, colour conversion and masks are applied by the reader of the samples, with CreateDecodeMap(DecodedImage), ImageRows and GetColorConverter(PdfColorSpace). Masks are decoded at their own size (Mask), never resampled here. Nothing is cached; each Decode() decodes again.
Thread-safe for concurrent reads while the document is not mutated.
kind:method, kind:property, kind:ctor. Press Esc to clear.AlternatesGets the image's alternates, in array order; empty when it has none (and always for an alternate).BitsPerComponentGets the bits per component: 1 for an image mask, the dictionary's value otherwise; 0 when it is missing or unusable, and for a JPEG 2000 image that does not state it (the codestream decides).ColorKeyGets the colour key ranges for ColorKey: a minimum and maximum raw sample value per component; otherwise null.ColorSpaceGets the colour space of the samples; null for an image mask, for a JPEG 2000 image without one (see ResolveColorSpace(DecodedImage)), and when it is missing or unusable.DecodeArrayGets the Decode array in effect: the dictionary's, else the default for the colour space and depth (Table 88). Two numbers per component; empty when the image cannot be decoded.DictionaryGets the image dictionary; for an inline image, its entries with the abbreviations of Tables 91 and 92 expanded.HeightGets the image's height in samples; 0 when Height is missing or not positive.IntentGets the rendering intent for the image's colours (Intent, PDF 1.1), or null to use the graphics state's.InterpolateGets a value indicating whether the image asks to be smoothed when scaled (Interpolate, default false).IsInlineGets a value indicating whether this is an inline image.IsStencilGets a value indicating whether the image is a stencil mask (ImageMask true), painted with the current fill colour.MaskKindGets which masking applies to the image.MatteGets the colour the samples were pre-blended with (the soft mask's Matte), one value per component of the image's colour space (of its base for Indexed); null when there is none or it cannot apply.MetadataGets the image's metadata stream (Metadata, PDF 1.4), or null.NameGets the image's name in the resource dictionary (Name, deprecated in PDF 2.0), or null.OptionalContentGets the image's optional content group or membership dictionary (OC, PDF 1.5), or null.ReferenceGets the indirect reference to the image's stream, or null when it is direct or inline.SoftMaskInDataGets SMaskInData: 0 (no opacity in the data), 1 (opacity), 2 (opacity premultiplied into the colour).StreamGets the image XObject's stream; null for an inline image.StructParentGets the image's key in the structural parent tree (StructParent, PDF 1.3), or null.WidthGets the image's width in samples; 0 when Width is missing or not positive.CreateDecodeMap(DecodedImage)Returns the Decode mapping for samples of this image decoded as decoded.Decode()Decodes the image's samples.RemoveOptionalContent()Removes the image's OC entry: it is no longer optional content.ResolveColorSpace(DecodedImage)Returns the colour space of samples decoded as decoded: the image's ColorSpace, else an ICCBased space over the ICC profile the codec reported (when its header is usable and its component count matches), else the colour model the codec reported, else the device space with as many components (1 gray, 3 RGB, 4 CMYK).SetOptionalContent(PdfOptionalContentGroup)Makes the image optional content of group (OC): shown only while the group is ON.SetOptionalContent(PdfOptionalContentMembership)Makes the image optional content whose visibility membership decides (OC).