

Neither of these exactly meets your requirements, as libpuzzle has a PHP interface, and pHash seems to require you to write a C program. Probably the same amount of coding would be required for this one. There's also pHash, an open source perceptual hashing library. It would take but a little coding to do what you want with it. I just found libpuzzle, "A library to find similar pictures" by chance. That guy uses Imagemagick and awk, but I'm not sure how you would test for equality or similarity in your case. You'd probably have to write or find some non-shell-script-code for that.Īnother one that comes to mind is finding dominant colors in an image. That sort of thing would make your grey scale images, and black-n-white images fall out as very distinct hash values.
Calculate pixel number linux imagemagick 64 bits#
Looks like Krawetz just uses the 64 bits as a hash value. Compute a 64-bit number (8 * 8 = 64) - "Each bit is simply set based on whether the color value is above or below the mean.Compute the mean value of the resulting 64 colors.Reduce color of the 8x8 image to grayscale.Krawetz "smashes" the image into an 8x8 square. You could try a method that Neal Krawetz, of FotoForensics fame, does: So it is uniform, but it's a uniform repeated pattern.Ĭan anyone think of a way I could do this at the command line? What makes this (I would assume) more difficult is that the dark grey one is not a uniform color, but is rather a repeated pattern of pixels, which looks like this in close up: The "fails" tend to be a uniform colour, either dark grey or white, and I thought I might be able to use this "degree of uniformity" as a way of programmatically rating the success of the thumbnail. What would help would be a way for my script to know when it had made a failed thumbnail, which seems to happen a lot. I pretty much need to stand over it to make it work at the moment and it's a PITA. The assets use Flash for the most part, and I'm capturing them via chromium-browser on the command line. I'm attempting to write a script which thumbnails our many thousands of assets.
