optimo
optimo is a free, open-source CLI that optimizes and converts images and videos for the web using ImageMagick and FFmpeg compression workflows.
What is optimo?
optimo is a free, open-source CLI tool for optimizing and converting images and videos for the web. It applies format-specific compression workflows built on ImageMagick for images and FFmpeg for videos, producing smaller files while aiming for predictable results.
The core purpose of optimo is to take media you already have (files or directories) and run reliable optimization steps—optionally including format conversion and resizing—without requiring you to manually assemble different tools and flags for each format.
Key Features
- Format-specific pipelines for many web formats: Uses ImageMagick-based steps for image formats (e.g., PNG, JPEG, WebP, AVIF, HEIC, JPEG XL, GIF, SVG) and FFmpeg-based compression for video formats (e.g., MP4, WebM, MOV, MKV, AVI, OGV).
- Lossless by default, optional lossy mode: Runs lossless compression preserving quality unless you enable
--lossyfor maximum compression. - Resize controls in one flag: Resize by percentage (e.g.,
50%), target file size (e.g.,100kB), or constrain dimensions usingw{number}/h{number}. - Dry-run mode for safe previews:
--dry-runshows what would change without modifying files—useful for testing and CI checks. - Batch and recursive directory processing: Processes directories recursively, skipping hidden files and unsupported formats automatically.
- Node.js / TypeScript-ready programmatic API: Use optimo from scripts to optimize single files (
optimo.file) or directories (optimo.dir), with result data including original/optimized sizes. - CLI control via simple flags: Includes options such as
--format(output format),--mute(remove audio tracks; default true), and logging controls like--verboseand--silent. - Requires external binaries for supported formats: Optimo resolves required compressors from your
PATHand errors if the necessary binaries are missing (for example, ImageMagick tools for image formats and FFmpeg for videos).
How to Use optimo
Start by running optimo with --dry-run to verify which files would be optimized and how the outputs would change. Then test on a single file first, and only after confirming the results, run it on directories for batch processing.
Common workflows include (1) optimizing in place for a given format, (2) resizing with --resize when dimension or size needs to change, and (3) converting to a specified output format with --format only when conversion is intended.
Use Cases
- Reduce page load and storage for mixed image sets: Optimize a directory of assets containing PNG, JPEG, WebP, AVIF/HEIC, GIF, and SVG in one run instead of handling each format separately.
- Apply controlled resizing for responsive layouts: Use
--resizeto scale by a percentage or constrain by width/height (e.g.,w960orh480) before committing optimized assets. - Aggressively shrink media when bandwidth matters: Enable
--lossywhen you need maximum compression rather than preserving quality with lossless defaults. - Optimize video exports with web-oriented compression: Compress video directories using FFmpeg-powered settings, optionally muting/removing audio tracks via the
--muteoption (default true). - Integrate into automated checks and version control: Run
--dry-runfor CI validation and set up a pre-commit hook so staged media files are auto-optimized before changes are committed.
FAQ
What does optimo build on? Optimo uses ImageMagick for image processing and FFmpeg for video compression.
Does optimo modify files by default?
No—use --dry-run to preview changes without modifying files. Without --dry-run, optimo runs optimization on the provided inputs.
Can I choose output formats?
Yes. Use the --format option to convert output to a specified format (for example, converting an image to webp). The source material notes using --format only when conversion is intended.
How does optimo handle batch processing? You can pass directories for recursive processing. Hidden files and unsupported formats are skipped automatically.
What tools do I need installed?
Optimo resolves required compressors from your PATH and throws if required binaries are missing. The required binaries vary by format (e.g., ImageMagick-related tools for image formats, FFmpeg for videos).
Alternatives
- Generic image/video optimization pipelines you assemble yourself: Using separate tools and flags manually (including ImageMagick/FFmpeg directly) can be flexible, but it typically requires format-specific decision-making that optimo centralizes.
- Format conversion-focused tools: Tools that mainly convert between image/video formats may not provide the same format-specific compression pipelines and defaults optimized for web use.
- Build-system or asset pipeline plugins: Asset pipeline integrations may automate optimization during builds, but the workflow and control granularity (e.g., resizing by file size or dry-run previews) may differ from a CLI-first tool like optimo.
Alternatives
Converleon
Converleon is an all-in-one offline file converter for macOS for batch converting mixed files, merging PDFs, exporting pages, extracting audio, and archives.
Codex Plugins
Use Codex Plugins to bundle skills, app integrations, and MCP servers into reusable workflows—extending Codex access to tools like Gmail, Drive, and Slack.
CAMB.AI
Turn a single live stream into a multilingual broadcast with real-time AI audio dubbing for YouTube, Twitch, X and more.
DeepMotion
DeepMotion is an AI motion capture and body-tracking platform to generate 3D animations from video (and text) in your web browser, via Animate 3D API.
LALAL.AI
LALAL.AI is a next-generation vocal remover and music source separation service that allows users to quickly and accurately extract vocal and instrumental tracks from audio and video files.
Captions.ai
Captions.ai is an online video editor and app with AI-powered editing, automatic captions, music, and AI avatars for faster video creation.