Expand description
Image processing utilities — resize, convert, and transform images.
Mirrors packages/coding-agent/src/utils/image-*.ts. Provides cross-platform
image processing for the agent’s vision capabilities.
§Features
- Resize: Scale images while maintaining aspect ratio
- Convert: Convert between image formats (PNG, JPEG, WebP)
- EXIF handling: Strip EXIF data for privacy
- Optimization: Reduce file size for API transmission
§Example
use rpi_tools::image_processing::{process_image, ImageProcessingOptions, OutputFormat};
let options = ImageProcessingOptions {
max_width: Some(1024),
max_height: Some(1024),
format: Some(OutputFormat::Jpeg { quality: 85 }),
strip_exif: true,
};
let processed = process_image(input_bytes, options)?;Structs§
- Image
Processing Options - Options for image processing.
Enums§
- Output
Format - Output format for processed images.
Functions§
- detect_
image_ mime - Detect the MIME type of an image from its bytes.
- get_
image_ dimensions - Get image dimensions without fully decoding the image.
- process_
image - Process an image according to the given options.