Enum ImageOutputFormat
The image formats the toolkit ENCODES: the output side of Encode(ImageOutputFormat, ImageEncoderOptions) and Save(string, ImageOutputFormat, ImageEncoderOptions). The toolkit decodes more formats than it encodes (HEIC, AVIF, GIF, PSD, ...); this enum is the honest list of what it can write, and EncodableExtensions is the same list as file extensions.
public enum ImageOutputFormat
Fields
Png = 0Portable Network Graphics: lossless, alpha, gray, RGB and one-bit images.
Jpeg = 1JPEG: lossy, gray, RGB (YCbCr-coded) and CMYK (YCCK-coded under an Adobe marker).
Webp = 2WebP: lossy or lossless, alpha.
Tiff = 3Tagged Image File Format: lossless codecs, JPEG-in-TIFF, one-bit Group 4, CMYK, multiple pages.
Bmp = 4Windows bitmap: uncompressed or RLE8 (gray only).
Tga = 5Truevision TARGA: uncompressed or RLE.
Pnm = 6Portable Anymap: PGM for gray, PPM for RGB, PAM for RGBA.
Examples
using LMKit.Media.Image;
using ImageBuffer image = ImageBuffer.Load("photo.heic");
byte[] jpeg = image.Encode(ImageOutputFormat.Jpeg, new ImageBuffer.ImageEncoderOptions { Quality = 85 });