I would like to check JPG files if they were manipulated to change the content.

What I consider NOT photoshopped:

  • Cropping
  • Rotating
  • (Scaling)
  • Image resolution
  • Automatic changes smartphones might make

What I consider photoshopping:

  • Adding a new image on top of parts of the old image
  • Changing text of a part of an image

How can this automatically be checked?

(And: Are there ready-to-use libraries for it?)

  • 1
    $\begingroup$ I found izitru.com - but I can't find an explanation what they do and no self-hosted version which I could look at $\endgroup$ Jan 10, 2018 at 8:38
  • $\begingroup$ If your image can be found online, you may use a search engine that can take an image as input (tiny eye, google image, ...) and compare each version of the image. $\endgroup$
    – Manu H
    Jan 16, 2018 at 16:47
  • $\begingroup$ you might find resolution changes difficult because if you upsize, you are altering the feather from pixel to pixel and it might seem 'altered' when it has not been augmented. JPEGs are difficult because the are a LOSSY compressed format..so with skill that helps hide subtle changes. $\endgroup$ Jan 17, 2018 at 5:21

2 Answers 2


Error Level Analysis as described Error Level Analysis, found at https://github.com/afsalashyana/FakeImageDetection seems to be one seems to be one way:

You exploit that local compression ratios might be different. And it seems to be possible to train neural networks on it.

I didn't find a paper which says how well this works so far


Actually I'm currently not working on this area but I remember something from past that may help you. JPG files use quantization, it is really difficult for forgery detection but I suggest you reading the following paper.

Performance analysis of forgery detection of JPEG image compression

The proposed forensic algorithm to discriminate between original and forged regions in JPEG images, under the hypothesis that the tampered image presents a double JPEG compression, either aligned (A-DJPG) or nonaligned (NA-DJPG). Unlike previous approaches, the proposed algorithm does not need to manually select a suspect region in order to test the presence or the absence of double compression artifacts. Based on an improved and unified statistical model characterizing the artifacts that appear in the presence of both A-DJPG or NA-DJPG, the proposed algorithm automatically computes a likelihood map indicating the probability for each 8 × 8 discrete cosine transform block of being doubly compressed. The validity of the proposed approach has been assessed by evaluating the performance of a detector based on thresholding the likelihood map, considering different forensic scenarios. The effectiveness of the proposed method is also confirmed by tests carried on realistic tampered images. An interesting property of the proposed Bayesian approach is that it can be easily extended to work with traces left by other kinds of processing.

  • $\begingroup$ You should add the title of the paper instead of "this paper". If add the title, one can find the paper even if the link breaks. $\endgroup$ Jan 16, 2018 at 18:21

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

Not the answer you're looking for? Browse other questions tagged or ask your own question.