diff --git a/.gitattributes b/.gitattributes new file mode 100644 index 0000000..8206e46 --- /dev/null +++ b/.gitattributes @@ -0,0 +1 @@ +*.jpg diff=image diff --git a/README.md b/README.md index 828bda6..19d875a 100644 --- a/README.md +++ b/README.md @@ -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 @@ -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 ------- diff --git a/example-comparison.png b/example-comparison.png deleted file mode 100644 index 88d6fe0..0000000 Binary files a/example-comparison.png and /dev/null differ diff --git a/images/Makefile b/images/Makefile new file mode 100644 index 0000000..70edb28 --- /dev/null +++ b/images/Makefile @@ -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' $@ diff --git a/images/earth.jpg b/images/earth.jpg new file mode 100644 index 0000000..9a04fb6 Binary files /dev/null and b/images/earth.jpg differ diff --git a/images/earth_with_label.jpg b/images/earth_with_label.jpg new file mode 100644 index 0000000..23d33fc Binary files /dev/null and b/images/earth_with_label.jpg differ diff --git a/images/example-comparison.png b/images/example-comparison.png new file mode 100644 index 0000000..6cb6016 Binary files /dev/null and b/images/example-comparison.png differ