A command-line tool to visualize differences between two images, rendered directly in your terminal.
The diff heatmap shows pixel differences using a color scale: black (identical) through blue, green, yellow to red (maximum difference). Magenta indicates regions where images differ in size.
imgap <image1> <image2>
Supports PNG, JPG, WebP, GIF, BMP, TIFF, and other common formats.
cargo install imgap
imgap auto-detects your terminal's image protocol:
- Kitty graphics protocol
- iTerm2 inline images (also WezTerm)
- Sixel (foot, xterm, mlterm, Windows Terminal, and others)
imgap natively understands git's external diff calling convention -- no wrapper script needed.
git config --global diff.image.command imgapIn your repository (or globally in ~/.config/git/attributes):
*.png diff=image
*.jpg diff=image
*.jpeg diff=image
*.webp diff=image
*.bmp diff=image
*.gif diff=image
Git pipes diff output through a pager (typically less), which does not understand image escape sequences. To see inline images in git diff, use an image-aware pager like lessi:
git config --global pager.diff lessiNow git diff will show visual image comparisons inline in your terminal.
cargo build --release
The binary will be at target/release/imgap. No non-Rust dependencies required.
