|
| 1 | +This directory contains facilities that allow to highlight changes |
| 2 | +between two images and to perform a 3-way merge of images. |
| 3 | + |
| 4 | +Prerequisites |
| 5 | +------------- |
| 6 | + |
| 7 | +ImageMagick - http://www.imagemagick.org/script/download.php |
| 8 | + |
| 9 | + |
| 10 | +Installation |
| 11 | +------------ |
| 12 | + |
| 13 | +Copy the files imgdiff and imgmerge into a directory that is in your PATH. |
| 14 | + |
| 15 | + |
| 16 | +Usage |
| 17 | +----- |
| 18 | + |
| 19 | +Activate imgdiff in your repository |
| 20 | + |
| 21 | +a. Define a custom diff driver: |
| 22 | + |
| 23 | + $ git config diff.imgdiff.command imgdiff |
| 24 | + |
| 25 | +b. Use the custom driver for your images, i.e. put |
| 26 | + a line like this in your .git/info/attributes: |
| 27 | + |
| 28 | + *.png diff=imgdiff |
| 29 | + |
| 30 | +Since this uses ImageMagick behind the scenes, all image formats |
| 31 | +are supported that your ImageMagick installation supports. |
| 32 | + |
| 33 | +You can also run the program from the command line like this: |
| 34 | + |
| 35 | + $ imgdiff pictureold.png picturenew.png |
| 36 | + |
| 37 | +Activate imgmerge in your repository |
| 38 | + |
| 39 | + |
| 40 | +a. Define a custom merge driver: |
| 41 | + |
| 42 | + $ git config merge.imgmerge.name "image merge driver" |
| 43 | + $ git config merge.imgmerge.driver "imgmerge %O %A %B %A" |
| 44 | + |
| 45 | +b. Use the custom driver for your images, i.e. put |
| 46 | + a line like this in your .git/info/attributes: |
| 47 | + |
| 48 | + *.png merge=imgmerge |
| 49 | + |
| 50 | +You can also run the merge driver from the command line like this: |
| 51 | + |
| 52 | + $ imgmerge base.png ours.png theirs.png result.png |
| 53 | + |
| 54 | +The merge algorithm produces no conflict if the changes on the branches |
| 55 | +("base" to "ours" vs. "base" to "theirs") are on disjoint sets of |
| 56 | +pixels. If the branches modify the same pixel, then this results in a |
| 57 | +conflict, and the conflicting pixels are set to "ours". |
| 58 | + |
| 59 | +The merge does not work with images that have an alpha channel. |
0 commit comments