Skip to content

Instantly share code, notes, and snippets.

View zarazan's full-sized avatar

Kyle zarazan

  • @Umee_CrossChain
  • Colorado
  • 00:38 (UTC -06:00)
View GitHub Profile
@zarazan
zarazan / colors.rb
Last active December 13, 2015 17:38
Detect the first three primary colors from an image using the RMagick gem
require 'RMagick'
include Magick
def convert_rgb(color)
color / 257
end
def convert_pixel(pixel)
{
:r => convert_rgb(pixel.red),