PeachImage

PeachImage Namespace

Classes  
AnimatedImage An in-memory, fully-decoded (or to-be-encoded) animated image: an ordered sequence of composited AnimatedImageFrames plus loop count. Codec-agnostic, mirroring Image: Load(Stream, DecoderOptions) and Save(Stream, string, EncoderOptions) dispatch to whichever of Image’s built-in codecs also support animation (GIF today), rather than any single format’s animation API being called directly.
AnimatedImageFrame A single decoded (or to-be-encoded) frame of an AnimatedImage: a fully composited canvas plus timing/disposal metadata.
DecoderOptions Base class for format-specific decode options. Format codecs derive their own options from this (JpegDecoderOptions, PngDecoderOptions, etc.) to add format-specific knobs, but the base class itself is directly constructible: when the only thing a caller needs is TargetPixelFormat — the common case for a format-agnostic Load(Stream, DecoderOptions) call, where the stream’s actual format isn’t known up front — construct a plain new DecoderOptions { TargetPixelFormat = ... } rather than guessing at an arbitrary concrete subtype. See TargetPixelFormat for the guarantee that makes this safe.
EncoderOptions Base class for format-specific encode options. Format codecs derive their own options from this.
IccColorProfile A parsed ICC color profile, exposing PeachImage’s optimized, colorimetric device→sRGB conversion to library consumers directly — the same engine JPEG decode already uses automatically for a CMYK source with an embedded profile (see GetIccColorProfile() and ConvertToSrgb() for the common case of converting an already-decoded Image). Supports Gray, RGB, and CMYK device color spaces — whatever the profile itself declares via DataColorSpace.
IccProfileException Thrown when IccColorProfile is given bytes that are too short, malformed, or resolve to a device color space or transform PeachImage’s ICC engine doesn’t support. Not derived from ImageFormatException — an ICC profile isn’t an image container format, and can be used independent of any decoded Image (e.g. loaded from a standalone .icc/.icm file).
Image An in-memory, single-frame, tightly-packed pixel buffer decoded from (or destined for) an image file.
ImageDecoder Decodes images into memory the caller owns, so a hot loop (a thumbnailer, a tile server) decodes into one reusable buffer instead of getting a fresh Image per call. Create one per thread; an instance is not safe for concurrent use.
ImageFormatException Base type for all exceptions PeachImage throws while identifying, decoding, or encoding images.
ImageMetadata Format-agnostic metadata associated with an Image.
ImageTooLargeException Thrown when an image would exceed a limit the caller set in DecoderOptions (MaxPixels or MaxExpansionRatio), before the memory for it is allocated or as soon as the limit is crossed.
PixelFormatExtensions Helper methods for reasoning about PixelFormat values.
RawMetadataProfile A raw, un-parsed metadata segment captured verbatim during decode so it can be inspected or re-emitted on encode without the core library needing to understand its internal structure.
ResizeOptions Options controlling Resize(int, int, ResizeOptions) and Resize(int, int, ResizeOptions).
UnknownImageFormatException Thrown when no registered codec recognizes an image’s format.
UnsupportedFormatException Thrown when an image is in a format PeachImage recognises but the caller’s AllowedFormats does not permit. It is thrown right after the format is recognised from the file’s signature and before any decoder for that format runs.
Structs  
ExifLocation The raw GPS location tags found in an image’s EXIF metadata (the GPS IFD, tags GPSLatitude, GPSLongitude, GPSDestLatitude and GPSDestLongitude and their Ref companions), exactly as recorded: nothing is geocoded, rounded or signed. Each coordinate is the unsigned decimal-degree value of the file’s degrees/minutes/seconds rationals; the hemisphere is in the matching Ref member ('N'/'S', 'E'/'W'), so a caller wanting a signed value negates for 'S' and 'W'.
ImageFormatInfo Capability and identity metadata for a single image format, independent of any particular image.
ImageInfo Lightweight image dimensions/format info obtainable without decoding full pixel data.
Enums  
AnchorPosition Which part of the source survives cropping (Crop), or where the source is placed within the padded canvas (Pad). Ignored for Exact and Max.
FrameDisposalMethod How an AnimatedImageFrame’s canvas region should be treated before the next frame is drawn. Modeled on GIF’s Graphic Control Extension disposal method (values 0-3; 0 “unspecified” and 1 “do not dispose” both mean “leave as-is” in practice, so they share DoNotDispose/ None here for the raw distinction while behaving identically) — the only format that uses it today, but the concept (and this type) is codec-agnostic.
IccColorSpace The device color space an IccColorProfile declares its transform expects.
IccRenderingIntent An ICC rendering intent (ICC.1:2010 §7.2.15), controlling how an IccColorProfile maps colors that fall outside the destination gamut. Pass null to ConvertToSrgb(ReadOnlySpan<byte>, Span<byte>, int, Nullable<IccRenderingIntent>, bool) to use the profile’s own declared DefaultRenderingIntent instead of choosing one.
ImageOrientation The orientation recorded in an image’s metadata (EXIF tag 0x0112 and its equivalents in other formats), which a viewer applies to the decoded pixels to display the image upright. Decoders never apply it themselves: the pixels and Width/Height are always as stored in the file.
MetadataProfileKind Identifies the kind of data carried by a RawMetadataProfile.
PixelFormat Identifies the in-memory layout of a decoded Image’s pixel buffer.
ResamplingFilter The resampling filter used to reconstruct pixel values when resizing an Image.
ResizeMode How ResizeOptions interprets the width/height passed to Resize(int, int, ResizeOptions)/Resize(int, int, ResizeOptions).