Reputation: 3484
I have 2 images: 1 raw image in pgm format 1 compressed image in pgn/jpg format
Is there a tool that can detect if the compressed image was created from the raw image?
I'm using c++ in linux, but any lead on this subject will be very helpful.
Upvotes: 1
Views: 93
Reputation: 207345
There are lots of ways to compare images. You can look at the:
There is a very good summary by Anthony Thyssen here.
If we take a greyscale Lena image and compare its PGM form with PNG and JPEG, you can get a good idea of the differences with ImageMagick at the command-line, like this:
# Compare lossy JPEG Lena with PGM
compare -metric RMSE lena.pgm lena.jpg null:
567.167 (0.00865442)
# Compare lossless PNG Lena with PGM
compare -metric RMSE lena.pgm lena.png null:
0 (0)
If I now generate a JPEG Lena with lower quality and compare with the PGM again, you can see that the error/difference is larger:
convert lena.pgm -quality 50 lena.jpg
compare -metric RMSE lena.pgm lena.jpg null:
1110.81 (0.0169498)
Upvotes: 1