Skip to content

Instantly share code, notes, and snippets.

@yaf
Created June 7, 2013 06:49
Show Gist options
  • Save yaf/5727475 to your computer and use it in GitHub Desktop.
Save yaf/5727475 to your computer and use it in GitHub Desktop.
rmagick color histo
require 'rmagick'
img = Magick::ImageList.new('sudo_graph_20110807.jpg')
puts Magick::QuantumDepth
histo_color = img.quantize(10).color_histogram
#http://xona.com/colorlist/
#8 255
#16 65535
#65535 -> 0
puts histo_color.keys
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment