miro icon indicating copy to clipboard operation
miro copied to clipboard

Add an extra option for colorspace

Open fmonroy opened this issue 7 years ago • 0 comments

Hey man, your gem is great, I'm using it and I love, however it can be better. I'm extracting colors from an image in my site, but the colors returned differ a little bit from those of the image. I found out that it's due to the colorspace, I had to change it to sRGB, the problem es that your gem uses the same option (quantize) for quantize and colorpace. I suggest you adding an extra option for the colorspace. I had to do the following in my code:

def image_magick_params
    if Miro.histogram?
        "':in[0]' -resize :resolution -colors :colors -colorspace \"sRGB\" -quantize :quantize -alpha remove -format %c histogram:info:"
    else
        "':in[0]' -resize :resolution -colors :colors -colorspace \"sRGB\" -quantize :quantize :out"
    end
end

fmonroy avatar Apr 11 '18 23:04 fmonroy