I need to know the average color from an image when I upload it to my Ruby on Rails application. Is it possible to get the average color value in HEX or in RGB to use this color later in the view that's going to display this image?
Something like:
img = Magick::Image.read(path).first
hexVal = img.getHexValue
See Question&Answers more detail:
os 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…