Last active
March 8, 2017 07:04
-
-
Save koyachi/c1077300ab8ce5c14ea03987709fc299 to your computer and use it in GitHub Desktop.
Revisions
-
koyachi revised this gist
Mar 8, 2017 . 1 changed file with 2 additions and 2 deletions.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -2,9 +2,9 @@ # via https://github.com/koyachi/diff_pdf_image/blob/master/diff_pdf_image.rb # before image_b=$1 # after image_a=$2 function to_gray { convert $1 -type GrayScale $1.gray.png -
koyachi created this gist
Mar 8, 2017 .There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -0,0 +1,31 @@ #!/bin/bash # via https://github.com/koyachi/diff_pdf_image/blob/master/diff_pdf_image.rb # before image_b=$2 # after image_a=$1 function to_gray { convert $1 -type GrayScale $1.gray.png } function to_blue { convert $1 +level-colors Blue,White $1.blue.png } function to_red { convert $1 +level-colors Red,White $1.red.png } function layer { convert $1 $2 -compose Multiply -composite $image_a.diff.png } to_gray $image_b to_gray $image_a to_blue $image_b.gray.png to_red $image_a.gray.png layer $image_b.gray.png.blue.png $image_a.gray.png.red.png