Last active
May 30, 2016 05:39
-
-
Save rtanglao/ed80e5b3008f11d7663d1f698d50073d 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
# from http://www.fmwconcepts.com/imagemagick/tidbits/image_info.php#ave_color | |
convert rose: -colorspace rgb -scale 1x1 \ | |
-format "%[fx:floor(255*r)],%[fx:floor(255*g)],%[fx:floor(255*b)]" info: | |
# output is: rgb(146,89,80) |
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
img = Magick::Image.read(path).first | |
pix = img.scale(1, 1) | |
averageColor = pix.pixel_color(0,0) | |
print averageColor.red (and then divide by 257) | |
# from http://stackoverflow.com/questions/5162929/is-it-possible-to-get-the-average-image-color-with-rmagick |
convert p4.png -resize 1x1 txt:-
# ImageMagick pixel enumeration: 1,1,255,srgb
0,0: (189,185,184) #BDB9B8 srgb(189,185,184)
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
grep -o "#......"