Take the 2-minute tour ×
Super User is a question and answer site for computer enthusiasts and power users. It's 100% free, no registration required.

I have a bunch of images (screenshots), that I would like to sort automaticly in subfolders.

Since these are screenshots, I was thinking that I could program something that would read each jpg, check if such and such part of the image matches a specific set of pixels, and move the file accordingly.

What's the fastest way to accomplish that ? I have C# and python on my system.

share|improve this question
add comment

2 Answers

up vote 4 down vote accepted

Maybe you could create these "pattern images" (with any image editing software) and then iterate over all the images you want to sort "comparing" them against the "pattern images". Given the result of this operation (the similarity between the "pattern image" and the "actual image") you can put them in the specific subfolder.

The "compare" process can be done with ImageMagick's compare tool, and make decisions based on the return value of the metric used to compare both images.

Regards.

share|improve this answer
    
How I didn't know that ImageMagick had a compare tool ! Maybe I can cut a part of the image, compare it with my sample and move the file, in a bash script... –  Manu Jan 10 '10 at 13:28
1  
I didn't know about this one, thanks Gaston. :) –  mechko Jan 10 '10 at 13:59
    
It works ! convert 02.jpg -crop 80x10+738+867 +repage tmpcrop.jpg compare -metric PSNR image.jpg tmpcrop.jpg tmpcomp.jpg Where image.jpg is a previous cut of what I know is supposed to be there. Now all I have to do is package it inside a script. Thanks ! –  Manu Jan 10 '10 at 14:22
add comment

You're best of going to stackoverflow with that one.

Do you know if each type of picture will have a certain image visible? I presume, being screenshots, you don't have the issue of things being scaled up and down randomly or at different angles.

It's actually a pretty intense program to run, but a naive implementation shouldn't be hard to write. Just build a tree of your emblems (things that identify each type of screenshot) and search for them pixel by pixel in the image. Or, just check the required locations for marks.

As for the language, I'd recommend NOT python. I don't C# is too bad with it, though. If you want, you can always install java and it's not too difficult to whip something up to do what you're asking. Hope this helps.

share|improve this answer
    
Thanks for the quick answer, i'll try moving it to stack. –  Manu Jan 10 '10 at 13:14
    
no problem. I'll see you there ;) –  mechko Jan 10 '10 at 13:15
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

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