Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions .gitattributes
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
*.jpg diff=image
13 changes: 12 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ $ diff-image anImageThatHasChanged1.jpg anImageThatHasChanged2.jpg
# The same as above, only using files on disk not git differences.
```

![Screenshot](example-comparison.png?raw=true)
![Screenshot](./images/example-comparison.png?raw=true)


Installation
Expand Down Expand Up @@ -91,6 +91,17 @@ It will tell you what it's done, so it should look something like this:
+ git config --global diff.image.command '~/git-diff-image/git_diff_image'
```

Try without installation
------------------------

```
git config diff.image.command $(realpath diff-image)
cd images
make earth_with_label.jpg
cp earth_with_label.jpg earth.jpg
git diff earth.jpg
```

Git LFS
-------

Expand Down
Binary file removed example-comparison.png
Binary file not shown.
8 changes: 8 additions & 0 deletions images/Makefile
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
earth.jpg:
curl https://www.nasa.gov/wp-content/uploads/2023/03/135918main_bm1_high.jpg -o $@

example-comparison.png: earth.jpg earth_with_label.jpg
../diff-image -o $@ $^

earth_with_label.jpg: earth.jpg
convert $^ -gravity South -pointsize 60 -undercolor white -stroke gray -fill gray -annotate +30+30 'The earth seen from Apollo 17' $@
Binary file added images/earth.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added images/earth_with_label.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added images/example-comparison.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.