oma
oma

Reputation: 40860

RGB image to CMYK and soften colors

How to

in ruby? It's for a rails app. Links are ok, code examples are awsome.

Upvotes: 4

Views: 1108

Answers (2)

thomax
thomax

Reputation: 9659

First, make sure you have imagemagick compiled with LCMS (on a mac brew install imagemagick --with-little-cms). You probably need to reinstall the rmagick gem after reinstalling imagemagick.

Next, get Adobe ICC color profiles (again, these are for mac, but I'm sure you have no trouble locating versions for other platforms).

Then fire up your editor, and do something along these lines.

image = Image.read("my_image.jpg")[0]
image.colorspace = Magick::CMYKColorspace
image.add_profile("path_to/adobe_icc_profiles/CMYK/USWebCoatedSWOP.icc")
image.write("my_image_cmyk.jpg")

Upvotes: 1

dimitarvp
dimitarvp

Reputation: 2383

I would say, use RMagick: http://rmagick.rubyforge.org/

Make sure to use version 2 and on, though, since it works with Ruby 1.9, too. Version 1 only works with 1.8.

As for an example however, I am not insanely experienced with ImageMagick. You can start here though:

http://www.imagemagick.org/script/command-line-tools.php

Upvotes: 0

Related Questions