ruby - Properly converting a CMYK image to RGB with RMagick -
I'm using below to make a color conversion
if @ image .colorspace == Magick :: CMYKColorspace # @ image.colorspace # = & gt; CMYKColorspace = 12 @ image.colorspace = Magick :: RGBColorspace @image = @ image.negate end
This works, almost, but the color brightness is far away. The fact is that I need to reject the image very bad odor.
The documentation mentions using color_profiles, but besides this I can not find much.
I am now trying
@image = @ image.quantize (16777216, Magick :: RGBColorspace)
And the colors are better, but still are closed.
Thank you peka, you pointed me at the answer (1).
You should have compiled the image magic with this installed, it may already be the case if any installer or package was used. But I was compiling from the source that it was easy to install LCMS from the source and as Image Magic Rebuild ( ./configure; create; install
).
ImageMagick works well to reproduce the exact color below: / Code> Then in RMagick, I use the following: FILENAME -profile / PATH_TO_PROFILE / sRGB.icm OUT.jpg
if the image coderespace == Magick :: CMYKColorspace # essentially adjust the path @ image .color_profile = "/ usr / local / share / imageMagick-6.5.4 / config / sRGB.icm" end @ image.write ("outside .jpg") {self.quality = 85}
Comments
Post a Comment