How esimov/caire works
Caire is a content-aware image resizing library with a CLI. The principal workflow accepts a local image, URL, stdin stream, or directory; decodes and prepares images and optional masks; resizes by seam carving; then writes the selected output format. Resizing supports shrinking, enlargement, horizontal and vertical dimensions, face-aware protection, and masks. Optional GUI preview visualizes progress and debug overlays. The README documents several capabilities whose implementation details were not sampled; those are represented at the supported processor path, with only documented relationships shown.
Main entry points: processor.go Resize orchestration · exec.go Input/output execution · gui.go Progress preview · main.go CLI options
Components 16
Entry and I/O
- CLI options
cmd/caire/main.go - Input/output execution
exec.go - Image output formats
exec.go - URL download
utils/download.go
Seam resizing
- Resize orchestration
processor.go - Seam energy and carving
carver.go - Protect and remove masks
processor.go - Face-aware protection
processor.go
Image operations
- Image decode and convert
image/image.go - Sobel energy map
image/sobel.go - Stack blur
image/stackblur.go
Preview and debug
- Progress preview
gui.go - Seam visualization
draw.go - Debug compositing
imop/comp.go - Debug blend modes
imop/blend.go
Other components
- User
Connections 17
- User → CLI options: sets options
cmd/caire/main.go - CLI options → Resize orchestration: configures and starts
cmd/caire/main.go - CLI options → Input/output execution: executes input
cmd/caire/main.go - Input/output execution → Resize orchestration: processes image
exec.go - Input/output execution → Image decode and convert: decodes masks
exec.go - Input/output execution → URL download: downloads URL input
exec.go - Input/output execution → Image output formats: encodes output
exec.go - Resize orchestration → Seam energy and carving: finds and applies seams
processor.go - Seam energy and carving → Sobel energy map: computes energy
carver.go - Resize orchestration → Image decode and convert: uses image operations
processor.go - Resize orchestration → Protect and remove masks: applies masks
processor.go - Resize orchestration → Face-aware protection: detects faces
processor.go - Resize orchestration → Stack blur: blurs for detection
- Resize orchestration → Progress preview: sends preview frames
processor.go - Progress preview → Seam visualization: draws seams
draw.go - Progress preview → Debug compositing: composites debug view
gui.go - Progress preview → Debug blend modes: uses blend modes
gui.go