Skip to main content

Module image_loader

Module image_loader 

Source
Expand description

§Image Loading and Decoding

Loads images from file paths, data URIs, or raw base64 strings and prepares them for PDF embedding. JPEG images pass through without re-encoding (the PDF spec supports DCTDecode natively). PNG images are decoded to RGB pixels with a separate alpha channel for SMask transparency.

Structs§

LoadedImage
A fully decoded/loaded image ready for PDF embedding.

Enums§

ImagePixelData
The pixel data in a format the PDF serializer can consume directly.
JpegColorSpace
JPEG color space for the PDF /ColorSpace entry.

Functions§

load_image
Load an image from a source string.
load_image_dimensions
Read only the pixel dimensions from an image source without decoding pixels. Returns (width, height) in pixels. Much cheaper than load_image.