Question

Is there a way to write a program that can identify photos vs. graphic images in a folder of jpg files?

sample photo http://dansdemos.info/clips/samples/photo.jpg

sample graphic image http://dansdemos.info/clips/samples/graphic.jpg

I was thinking ImageMagic compare could do it, if it was provided a set of samples it could use to calculate differences between images. I was thinking coming up with that might be tricky, so I was hoping there might be a simpler approach. Maybe something as simple as a Google search I have not thought of. Any help or comment would be much appreciated. Thank you.

Was it helpful?

Solution

You could have the program check for Exif data of various kinds, like the camera manufacturer.

It wouldn't be foolproof, but it would probably work in most cases, as long as the Exif data hasn't been removed from photos by some postprocessing step.

It worked just fine on your two sample images. E.g. your photo of guinea fowl has Exif data for camera maker, camera model, f-stop, exposure, etc. The graphic.jpg appears to have none of those.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top