- grab the most "exciting" part of the image
- "exciting" => least average according to unweighed color
- checks every single 100 X 100 splotch, so it's very inefficient. Not checking every single subimage would be the most obvious improvement, but frankly, doing image processing in native ruby is probably not the best idea anyhow.
- special bonus! also finds the least interesting 100X100 subimage.
- usage:
ruby chunky.rb <inputfn.png>
- most "exciting" crop is saved as
<inputfn.png>.max.png
- most "boring" crop is saved as
<inputfn.png>.min.png
- extremely well for the duck
- well for the cat
- so-so for the dog
Actually in the case of the dog, the bit identified as "most boring" is a pretty good crop. Reason being that the dog picture has little variation: half big black dog, half green. All said, though, the dog crop is acceptable and by far not the worst possible choice.
- tons of performance optimizations
- calculating the averages differently, especially perception weighting the individual color channels or hsv components.
- doing this properly would require more sophisticated algorithms, I doubt it would be feasible with ChunkyPNG
Nice results, simple code. I like this solution.