-2

I am not a coder, but I do understand logic and usually I am able to do simple coding with PHP.

I'm looking to implement Error Level Analysis with PHP. You can see an example in this link.

Is it possible to implement ELA with ImageMagick or GD ? Any functions that I should look into it ?

fmw42
  • 46,825
  • 10
  • 62
  • 80
Daniel Oliveira
  • 51
  • 1
  • 1
  • 4
  • Error level analysis of what? What are they doing to the image in your reference? What is the algorithm or mathematics of what they are doing. What is a reference? What have you tried? – fmw42 Jul 29 '18 at 23:30
  • The link you post, https://fotoforensics.com, is not accessible. It is an upload form. Do you have the correct link? – fmw42 Aug 10 '22 at 22:50

1 Answers1

0

This reference - http://www.errorlevelanalysis.com - seems to imply that you recompress a JPG image at some other compression amount (namely, 95%) and then do a pixel-by-pixel difference. You can do that in ImageMagick (or PHP Imagick).

For example in ImageMagick 6:

Input:

enter image description here

convert barn.jpg \( +clone -quality 95 \) -compose difference -composite -auto-level -gamma 1.5 barn_ela.png


enter image description here

I have stretched the result to full dynamic range using -auto-level and then did a non-linear gamma adjustment to enhance the differences.

See also https://sites.google.com/site/elsamuko/forensics/ela, where they provide two separate images and are looking for where they differ most as change detection.

fmw42
  • 46,825
  • 10
  • 62
  • 80