Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/niedzielski/git-diff-img
π· Diff Git versioned images graphically.
https://github.com/niedzielski/git-diff-img
compare comparison delta diff difference git git-diff git-difftool image-diff imagemagick
Last synced: 21 days ago
JSON representation
π· Diff Git versioned images graphically.
- Host: GitHub
- URL: https://github.com/niedzielski/git-diff-img
- Owner: niedzielski
- License: unlicense
- Created: 2016-12-20T04:05:34.000Z (about 8 years ago)
- Default Branch: main
- Last Pushed: 2023-01-02T02:35:16.000Z (almost 2 years ago)
- Last Synced: 2024-11-29T16:39:27.728Z (30 days ago)
- Topics: compare, comparison, delta, diff, difference, git, git-diff, git-difftool, image-diff, imagemagick
- Language: Shell
- Homepage:
- Size: 354 KB
- Stars: 76
- Watchers: 6
- Forks: 2
- Open Issues: 0
-
Metadata Files:
- Readme: readme.md
- License: license.text
Awesome Lists containing this project
README
# git-diff-img
![Example difference after replacing the left hand side with the right](doc/spot-the-diff-montage.png)
The result of `git diff-img`. Sample image by
[Muband](https://ja.wikipedia.org/wiki/%E5%88%A9%E7%94%A8%E8%80%85:Muband) from
the [Spot the difference](https://en.wikipedia.org/wiki/Spot_the_difference)
Wikipedia article; distributed under a CC BY-SA 3.0 license## Installation
### System Prerequisites
Install ImageMagick: `sudo apt install imagemagick`.### As a Git configuration (**recommended**)
```bash
git config --global alias.diff-img difftool\ -x\ \''compare -alpha copy "$LOCAL" "$REMOTE" png:- | montage -mode concatenate "$LOCAL" png:- "$REMOTE" png:- | display -title "$BASE: Local | Diff | Remote" png:-'\'
```### As an executable (**not** recommended)
This is an *alternative* installation procedure that is unnecessary if the Git
configuration is used. It's not recommended because it requires an understanding
of PATH lookup```bash
curl https://raw.githubusercontent.com/niedzielski/git-diff-img/master/git-diff-img -o ~/bin/git-diff-img &&
chmod +x ~/bin/git-diff-img
```## Usage
Execute against images only: `git diff-img **.png`## Tips
π‘ Resizing the diff to fit your monitorβ¦
Newer versions of ImageMagick support resizing the diff to fit large images to
the screen. Consider adding
[the `-resize` argument](https://imagemagick.org/script/command-line-options.php#resize)
to `display` if you want this behavior. Eg, instead of:```
display -title "$BASE: Local | Diff | Remote" png:-
```Try:
```
display -resize 1900x -title "$BASE: Local | Diff | Remote" png:-
```## Examples
![The percentage symbol differs](doc/example-font.png)
_Version a [font](https://rndmem.com) sprite sheet and see the concrete difference in each commit._## Links
- [delta](https://github.com/dandavison/delta)
- [diff-so-fancy](https://github.com/so-fancy/diff-so-fancy)
- [Improved Colored Diff](https://github.com/jeffkaufman/icdiff)## License (Public Domain)
All code is public domain and may be used without limitation.