Last active
August 29, 2015 14:14
-
-
Save daveyjones/1a3b8e72e2a89f730044 to your computer and use it in GitHub Desktop.
A simple Node.js script that uses GraphicsMagick (or ImageMagick) to perform image forensics on a JPEG. The script detects areas of a JPEG image that have been modified and highlights them in red.
This file contains 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 characters
var exec = require("child_process").exec; | |
var fs = require("fs"); | |
exec("gm convert test.jpg -quality 95 new.jpg", function (error, stdout, stderr) { | |
exec("gm compare -highlight-style Assign -highlight-color red -file out.jpg test.jpg new.jpg", function (error, stdout, stderr) { | |
// Done. | |
}); | |
}); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment