Detect if image is a photo

Is it possible to detect if an image is probably a photo, not something like a line drawing or a scan of a document?

My use case is checking a bunch of .png, many of which are photos and should be converted to .jpg.

1 Like

If you have a bunch of examples already to learn from, I bet you can make a simple model using the Create ML app, and then run them through a Classify Images node. Then you’d use the Rules node to filter out either photos or line drawings.

If you’ve got a couple hundred examples, I can try it out on my end.

That sounds like a lot, and also possibly not a bulletproof solution. Maybe I need to approach this from a different angle – is it possible to convert an image to both .png and .jpeg and then keep whichever file is smaller?

It’s possible to convert it to both types, but there’s no way to compare two images and say “keep this one because it’s smaller”.