Skip to main content

Crate vision_squeezer

Crate vision_squeezer 

Source

Structs§

DimensionResult
OptimizationReport
OptimizeResult
Persistence
ProcessConfig
All tuneable knobs for the pipeline.
ProcessConfigBuilder
ProcessResult
SavingsReport
SqueezerStats
TokenEstimate
TokenSavingsTable
Full token savings report for a before/after dimension pair across all models.

Enums§

ImageOp
Atomic image operations for the Sandbox mode.
OutputFormat
Output encoding format.
ProcessMode
VisionModel
Supported vision model families with their patch pricing.

Functions§

binarize
calculate_optimal_dimensions
Snap W×H to tile boundaries using default tile size (512).
calculate_optimal_dimensions_with
Snap W×H to tile boundaries using a custom tile size.
crop_padding
Remove solid-color borders using corner sampling + configurable tolerance.
decode_base64_image
detect_ocr_mode
encode_image_base64
encode_to_bytes
Encode image to raw bytes using the configured output format.
estimate_tokens
Estimate LLM vision tokens for an image of given dimensions.
fit_within
Scale dimensions to fit within max_side while preserving aspect ratio.
fit_within_pixels
Scale dimensions to fit within both a max-side limit and a total-pixel limit.
optimal_send_dimensions
Compute the optimal dimensions to send to a given model to minimize tiles.
optimize_image
MCP entry point: base64 in → base64 JPEG out + savings report.
process
Full pipeline: [crop] → tile-snap resize → [OCR binarize]. Pass input_bytes = 0 if unknown (omits file-size from report).
process_with_operations
Execute a sequence of operations on an image.
token_savings_table