You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Add output format conversion (PNG, JPEG, WebP, GIF) #90
Currently squish resizes images but preserves the input format. When resizing images for different contexts (web, social media, documentation), users often need to convert formats alongside resizing.
Proposed API
# Convert to JPEG during resize
squish -o output.jpg --format jpeg input.png
# Auto-detect format from output file extension
squish -o output.webp input.jpg
# Control JPEG/WebP quality
squish -o output.jpg --format jpeg --quality 85 input.png
Rationale
The image crate (already a dependency via 0.25.x) has built-in support for encoding/decoding PNG, JPEG, WebP, and GIF. This means:
No new heavyweight dependencies — image already handles format conversion
The resize pipeline is already decoding into an image::DynamicImage before resizing, so encoding to a different format at the output stage is a natural extension
Common use case: screenshot tools produce PNG, but users often want JPEG for smaller file sizes when sharing
Alternative
A simpler approach would be to infer the output format from the --output-file extension when provided, rather than requiring an explicit --format flag.
Activity