
Caire
Go library and command-line tool that resizes images by removing low-importance seams, keeping key content int
- Stars
- 10.9k
- Forks
- 402
- Licence
- MIT
- Language
- Go
- Last update
- 8 days ago
- Type
- CLI
What it is
Caire is an open-source tool for resizing images in a content-aware way. Instead of simply cropping or stretching a picture, it finds connected paths of low-energy pixels (seams) that are least noticeable and removes or adds them, so the main subjects keep their shape. It is written in Go and can be used as a library, a command-line program, or with a preview window.
- Shrink a landscape photo to a narrower width while keeping people in the frame unchanged
- Convert a set of photos to square dimensions with the -square option
- Resize a whole directory of images concurrently by pointing -in and -out at folders
- Pipe an image from curl or stdin through caire and write the result to stdout
Great for
- Developers who need to resize images inside a Go program
- Designers who want to shrink photos without distorting the main subject
- People batch-resizing a folder of images from the command line
- Users who want to keep faces from being squashed, using the face detection option
Not ideal for
- People who only need quick, simple resizing; standard tools are faster and easier for that
- Users who need a graphical editor, since the README describes the GUI only as a progress/preview window
- Those needing very large images processed quickly, as the README does not give performance figures
How to get it
- 1
Install with a package manager
You'll need: Go
Install the caire command with Go
go install github.com/esimov/caire/cmd/caire@latestInstall via Homebrew (macOS)
brew install caire - 2
Run it
- Install Go and make sure $GOPATH/bin is on your PATH.
- Run the install command for the caire tool.
- Resize an image with: caire -in input.jpg -out output.jpg
- Add -width and -height values to set the new size; use -perc=1 to treat them as percentages.
- 3
Get the most out of it
- Use -face=1 to avoid distorting detected faces during resizing
- Use -preview=false to turn off the GUI window when running scripts
- Use -mask and -rmask with a mask image to protect or remove areas
- Use stdin and stdout with - to chain caire into other command-line pipelines
- Point -in and -out at folders to process many images concurrently
Downloads
Strengths
- Preserves important content such as faces when resizing, using seam carving plus optional face detection
- Offers flexible command-line options for percentage, square, proportional, and mask-based resizing
- Released under the MIT license with a large community following
Trade-offs
- The README does not document performance or memory use, so speed on large images is unknown
- Requires Go for the standard install method; Homebrew and release binaries are also mentioned but not detailed
- Some features like the GUI need extra system dependencies per the Gio project
How it compares
| Project | Stars | Type | Level | Updated | Best for |
|---|---|---|---|---|---|
| caire (this) | 10.9k | CLI | intermediate | 8 days ago | Developers who need to resize images inside a Go program |
| ai-engineering-from-scratch | 76.3k | Learning resource | intermediate | 4 days ago | Students who want to understand how LLMs, retrieval, and agents work internally |
| AI-For-Beginners | 70.5k | Learning resource | beginner | 13 days ago | Beginners who want a structured, self-paced introduction to AI |
| face_recognition | 56.9k | Library | intermediate | 4 months ago | Python developers prototyping photo sorting or face matching |
| supervision | 51.5k | Library | intermediate | 4 days ago | Python developers building apps on top of object detection or segmentation models |
| albumentations | 15.3k | Library | beginner | 1.4 years ago | Machine learning engineers training image classification or segmentation models with limited data |
Stats synced from GitHub. The assessment above was drafted with AI from the project's README on 2026-10-29 and may miss recent changes — check the README before relying on a command. MIT licence: free to use, modify and distribute, including commercially, as long as you keep the copyright notice.