Skip to content

Instantly share code, notes, and snippets.

@daveyjones
Last active August 29, 2015 14:14
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save daveyjones/1a3b8e72e2a89f730044 to your computer and use it in GitHub Desktop.
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.
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