Created
August 15, 2010 19:27
-
-
Save Vaguery/525854 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| # draws a random polygon (with absolute size!) of a random color and transparency | |
| def rand_poly | |
| "-fill \"rgba(#{rand()*100}, #{rand()*100}, #{rand()*100}, #{rand()})\" -stroke none -draw \"polyline #{rand(640)},#{rand(480)} #{rand(640)},#{rand(480)} #{rand(640)},#{rand(480)} #{rand(640)},#{rand(480)}\" " | |
| end | |
| # drop some random polygons onto the stupid wizard logo image | |
| `convert logo: #{rand_poly} #{rand_poly} #{rand_poly} logo.tif` | |
| # compare the original to the new image, and report the root mean squared error | |
| `compare -verbose -metric RMSE logo: logo.tif logodiff.tif` | |
| # show me both the new messy one and the result of `compare` | |
| `open logo.tif` | |
| `open logodiff.tif` |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment