473,394 Members | 1,739 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,394 software developers and data experts.

Regarding color conversion (RGB->CMYK)

Hi all,

I hope someone can help me.

I have do do a color conversion from RGB to CMYK. It's harder than I
thought :D Anyway, here is my problem.

I tried some differents ways to do it - I have a TIFF RGB file that I
need to convert to CMYK colorspace.

First of all I tried ImageMagick - it works - or it doesn't. Its give me
an CMYK TIFF - but with way wrong colors :( Nothing seems to be quite
right in that picture - tried google - and it seems that other people
have the same problem as me :(

After that my thoughts was on PIL (Python Imaging Library). The colors
was better - but to bright - cause it didn't include K (so it was
basicly a RGB=>CMY conversion - Black is 100% Cyan, Magenta and Yellow).
I tried some googling - and again - some people said that PIL shouldn't
be used for images that should be printed "professional".

Now, I don't have any clue about what I need to do? Is there another way
to solve my problems? Any tools that can convert somehow? Or any kind of
examples I can try to read?

It have to run on a Linux box - Python, Perl, PHP, bash whatever :(

Though about GIMP - but can find any information about how I can do a
conversion in command-line? Any one having knowlegde about this?

Looking forward to hear from you and I will appreciate any kind of help.

With Best Regards,
Johan Holst Nielsen
Jul 18 '05 #1
4 6702
Johan Holst Nielsen wrote:
After that my thoughts was on PIL (Python Imaging Library). The colors
was better - but to bright - cause it didn't include K (so it was
basicly a RGB=>CMY conversion - Black is 100% Cyan, Magenta and Yellow).

Then make a K layer:
K = min(C,M,Y)
and reset C, M, Y = C-K, M-K, Y-K
Jul 18 '05 #2
Johan Holst Nielsen <sp**@phpgeek.dk> wrote in message news:<41***********************@dread15.news.tele. dk>...
Hi all,

I hope someone can help me.

I have do do a color conversion from RGB to CMYK. It's harder than I
thought :D Anyway, here is my problem.
[snip]
After that my thoughts was on PIL (Python Imaging Library). The colors
was better - but to bright - cause it didn't include K (so it was
basicly a RGB=>CMY conversion - Black is 100% Cyan, Magenta and Yellow).
I tried some googling - and again - some people said that PIL shouldn't
be used for images that should be printed "professional".

This link might be a start.
'http://mail.python.org/pipermail/image-sig/2001-March/001386.html'
Basically you are right the conversion is not straightforward and is
somewhat error prone. Most of the time you have to tweak the colors,
especially the deep blues. It is somewhat unavoidable when you map a
additive colorsystem to a subtractive colorsystem. Maybe others might
have a commandline hack for you.

HTH,
M.E.Farmer
Jul 18 '05 #3
"Johan Holst Nielsen" <sp**@phpgeek.dk> wrote in message
news:41***********************@dread15.news.tele.d k...
Hi all,

I hope someone can help me.

I have do do a color conversion from RGB to CMYK. It's harder than I
thought :D Anyway, here is my problem.

I tried some differents ways to do it - I have a TIFF RGB file that I need
to convert to CMYK colorspace.

First of all I tried ImageMagick - it works - or it doesn't. Its give me
an CMYK TIFF - but with way wrong colors :( Nothing seems to be quite
right in that picture - tried google - and it seems that other people have
the same problem as me :(

After that my thoughts was on PIL (Python Imaging Library). The colors was
better - but to bright - cause it didn't include K (so it was basicly a
RGB=>CMY conversion - Black is 100% Cyan, Magenta and Yellow).
I tried some googling - and again - some people said that PIL shouldn't be
used for images that should be printed "professional".

Now, I don't have any clue about what I need to do? Is there another way
to solve my problems? Any tools that can convert somehow? Or any kind of
examples I can try to read?

It have to run on a Linux box - Python, Perl, PHP, bash whatever :(

Though about GIMP - but can find any information about how I can do a
conversion in command-line? Any one having knowlegde about this?

Looking forward to hear from you and I will appreciate any kind of help.

With Best Regards,
Johan Holst Nielsen


There is no simple way to convert RGB to CMYK for the simple reason that
CMYK is a device dependent color space. (Actually, unless it is calibrated
somehow RGB is a device dependent color space also.) A good way to do the
conversion is to get the ICC profile for the device that made the RGB and
another ICC profile for the device which will print the CMYK and convert one
to the other using a color management module -- aka a CMM. I don't know if
ImageMagick can do this for you or not but it would be very hard to get the
colors right any other way.

--
Cy
http://home.rochester.rr.com/cyhome/
Jul 18 '05 #4
Cy Edmunds wrote:
There is no simple way to convert RGB to CMYK for the simple reason that
CMYK is a device dependent color space. (Actually, unless it is calibrated
somehow RGB is a device dependent color space also.) A good way to do the
conversion is to get the ICC profile for the device that made the RGB and
another ICC profile for the device which will print the CMYK and convert one
to the other using a color management module -- aka a CMM. I don't know if
ImageMagick can do this for you or not but it would be very hard to get the
colors right any other way.


LittleCMS has Python bindings.

http://www.littlecms.com/

--
Robert Kern
rk***@ucsd.edu

"In the fields of hell where the grass grows high
Are the graves of dreams allowed to die."
-- Richard Harter
Jul 18 '05 #5

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

2
by: Russell Reagan | last post by:
In a newer version of a chess program I am writing, I have created classes that are (more or less) drop in replacements for things that used to be plain old integer or enumerated variables (colors,...
10
by: Whitney Kew | last post by:
Hello, I have a question regarding type conversion operators. Let's say I have a simple (nonsensical) class as follows: class MakeNewInt { private: int* _n;
7
by: Michael Lehn | last post by:
Hi, I have a question regarding the conversion of objects. When is the conversion done by the constructor and when by the operator. My feeling tells me that the constructor is preferred. But...
3
by: Chandu | last post by:
Hi, I am working on awk programming which is similar to C programming and have got a doubt about time function returning a float value. Ex: 01:01:30 should return 61.5 when i have tried my way i...
9
by: Codemonkey | last post by:
Hi, Sorry for a stupid question, but is it possible to do a narrowing conversion with an object array with Option Strict On in VB? E.g: ------------------ Dim aBase as Base() = {New...
4
by: riya1012 | last post by:
hello guys, I need some help from you. I am doing a DSP project and for that I need to do some C coding for the conversion of sample data which is in floating point representation to fixed point...
13
by: junky_fellow | last post by:
guys, I have a question regarding pointer conversion. Please look at the following code snippet. char *cptr; int *iptr; /* Some code here that initializes "iptr" */
1
by: SUBHABRATA | last post by:
Dear Group, I have some queries regarding XML conversion of some .txt/.doc files. I am thinking to use Satine. Is it OK? But it seems to support Python2.3 but does it support 2.5, too? If any one...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.