RGB to CMYK

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
12 messages Options
Reply | Threaded
Open this post in threaded view
|

RGB to CMYK

Rowland, Kevin
Hi all,

 

Is there a way to convert an RGB image to a CMYK image in Image J?

 

Thanks,

Kevin
Reply | Threaded
Open this post in threaded view
|

RGB to CMYK

Rowland, Kevin
Hi all,

 

Is there a way to convert an RGB image to a CMYK image in Image J?

 

Thanks,

Kevin
Reply | Threaded
Open this post in threaded view
|

Re: RGB to CMYK

Duane and Julie
In reply to this post by Rowland, Kevin
Hmmm.

For which RGB phosphors?
For what white point?
For which CMYK inks?
For what substrate?

If you don't care about any of that, it's pretty straight-forward.  
The 1-Color thing will probably work OK, and you can do simple under-
color removal for the black.  I've got some code around somewhere  
that does that, and halftones it as well if you wish.  I assume you  
want this for printing, or print proofing?

I don't have an ImageJ plugin, but I do have the code that I  
mentioned above.  If you can tell me why it's a good idea, I might be  
convinced to create a plugin.

Cheers,

    duane

On Nov 3, 2006, at 1:07 PM, Rowland, Kevin wrote:

> Hi all,
>
>
>
> Is there a way to convert an RGB image to a CMYK image in Image J?
>
>
>
> Thanks,
>
> Kevin
Reply | Threaded
Open this post in threaded view
|

Re: RGB to CMYK

Gary Chinga
If you make a search for "RGB to CMYK" in the list archives you will  
find the following post with a plugin for simple conversions:

https://list.nih.gov/cgi-bin/wa?A2=ind0403&L=IMAGEJ&P=R1754&I=-3

Gary,





On Nov 5, 2006, at 1:01 AM, Duane & Julie wrote:

> Hmmm.
>
> For which RGB phosphors?
> For what white point?
> For which CMYK inks?
> For what substrate?
>
> If you don't care about any of that, it's pretty straight-forward.  
> The 1-Color thing will probably work OK, and you can do simple  
> under-color removal for the black.  I've got some code around  
> somewhere that does that, and halftones it as well if you wish.  I  
> assume you want this for printing, or print proofing?
>
> I don't have an ImageJ plugin, but I do have the code that I  
> mentioned above.  If you can tell me why it's a good idea, I might  
> be convinced to create a plugin.
>
> Cheers,
>
>    duane
>
> On Nov 3, 2006, at 1:07 PM, Rowland, Kevin wrote:
>
>> Hi all,
>>
>>
>>
>> Is there a way to convert an RGB image to a CMYK image in Image J?
>>
>>
>>
>> Thanks,
>>
>> Kevin
>
>
Reply | Threaded
Open this post in threaded view
|

Duane - RGB to CMYK

Rowland, Kevin
In reply to this post by Duane and Julie
You are right - I don't care about any of that.  A lot of publishers
require images to be uploaded in CMYK format for their printing process.
I don't want to buy Photoshop just for that!
Cheers,
Kevin

-----Original Message-----
From: ImageJ Interest Group [mailto:[hidden email]] On Behalf Of
Duane & Julie
Sent: Saturday, November 04, 2006 6:02 PM
To: [hidden email]
Subject: Re: RGB to CMYK

Hmmm.

For which RGB phosphors?
For what white point?
For which CMYK inks?
For what substrate?

If you don't care about any of that, it's pretty straight-forward.  
The 1-Color thing will probably work OK, and you can do simple under-
color removal for the black.  I've got some code around somewhere  
that does that, and halftones it as well if you wish.  I assume you  
want this for printing, or print proofing?

I don't have an ImageJ plugin, but I do have the code that I  
mentioned above.  If you can tell me why it's a good idea, I might be  
convinced to create a plugin.

Cheers,

    duane

On Nov 3, 2006, at 1:07 PM, Rowland, Kevin wrote:

> Hi all,
>
>
>
> Is there a way to convert an RGB image to a CMYK image in Image J?
>
>
>
> Thanks,
>
> Kevin
Reply | Threaded
Open this post in threaded view
|

Re: RGB to CMYK

Kateo
In reply to this post by Duane and Julie
HI Duane,
I was wondering if you could expand on how to convert RGB--> CMYK. I have no clue about these things, but I found a paper that before analyzing the colours in histological sections performed colour separation into CMYK before dertermining the % of colours in their section. I want to determine the % of orange/red vs. green colour in my sections stained with picrosirius red and viewed under a polarized microscope. Anyway, I would appreciate your guidance... or anyone else's!
Thanks,

Kate
Reply | Threaded
Open this post in threaded view
|

Re: RGB to CMYK

Stephan Saalfeld
In the trivial case, that is when the intensity value stored for each
color channel is linear, grey is ( red + green + blue ) / 3 and no color
profiles are in the way, the conversion is quite easy.  Let r, g and b
be red, green and blue in unsigned byte range [0...255] and calculate c,
m, y and k as floating point in range [0...1]:

c = 1.0 - r/255.0
m = 1.0 - g/255.0
y = 1.0 - b/255.0

That's CMY from which CMYK is derived by extracting the grey component
into a fourth channel and scaling the remaining color channels
respectively:

k = min( c, y, k )
if ( k == 1.0 )
  c = m = y = 0
else
  s = 1.0 - k
  c = ( c - k ) / s
  m = ( m - k ) / s
  y = ( y - k ) / s

For the application, you have in mind, I do not think that conversion
into CMYK is of any help.  It does not add any information to your data.
Better look at Gabriel Landini's Colour Deconvolution plugin and
directly estimate the percentage of the colors you're looking for:

http://www.dentistry.bham.ac.uk/landinig/software/cdeconv/cdeconv.html

Best,
Stephan



On Thu, 2010-05-13 at 06:44 -0700, Kateo wrote:

> HI Duane,
> I was wondering if you could expand on how to convert RGB--> CMYK. I have no
> clue about these things, but I found a paper that before analyzing the
> colours in histological sections performed colour separation into CMYK
> before dertermining the % of colours in their section. I want to determine
> the % of orange/red vs. green colour in my sections stained with picrosirius
> red and viewed under a polarized microscope. Anyway, I would appreciate your
> guidance... or anyone else's!
> Thanks,
>
> Kate
Reply | Threaded
Open this post in threaded view
|

Re: RGB to CMYK

dashko
Can you code example of this conversion?
I am using ImageJ as library and i have no clue :)

Thanks!
Reply | Threaded
Open this post in threaded view
|

Re: RGB to CMYK

Stephan Saalfeld
For educational purposes, I implemented the trivial conversion and a
visualization in BeanShell.  Find it here:

http://pacific.mpi-cbg.de/wiki/index.php/RGB_to_CMYK

Best,
Stephan



On Fri, 2010-05-14 at 10:22 -0700, dashko wrote:

> Can you code example of this conversion?
> I am using ImageJ as library and i have no clue :)
>
> Thanks!
>
>
> -----
> --
> Michal Bystricky
> student of Slovak Technical University
> Faculty of Informatics and Information Technologies
Reply | Threaded
Open this post in threaded view
|

Re: RGB to CMYK

Rasband, Wayne (NIH/NIMH) [E]
On May 15, 2010, at 10:26 AM, Stephan Saalfeld wrote:

> For educational purposes, I implemented the trivial conversion and a
> visualization in BeanShell.  Find it here:
>
> http://pacific.mpi-cbg.de/wiki/index.php/RGB_to_CMYK
>
> Best,
> Stephan

There is a plugin (Java) version of Stephan's BeanShell script available at

    http://rsbweb.nih.gov/ij/plugins/cmyk/index.html

It includes a public method that converts an RGB image into a 32-bit CMYK stack.

-wayne


> On Fri, 2010-05-14 at 10:22 -0700, dashko wrote:
>> Can you code example of this conversion?
>> I am using ImageJ as library and i have no clue :)
>>
>> Thanks!
>>
>>
>> -----
>> --
>> Michal Bystricky
>> student of Slovak Technical University
>> Faculty of Informatics and Information Technologies
Reply | Threaded
Open this post in threaded view
|

Re: RGB to CMYK

Kateo
In reply to this post by Stephan Saalfeld
HI Stephan,

Thank you very much for your reply! I appreciate your insight, and  
agree that perhaps I don't need to convert my image to CMYK.

I have tried using the color deconvoluter. However, I do not believe  
it will work with the type of images I am looking at. We stained them  
with picrosirius red to enhance the bifringency of collagen. We then  
looked at the slides under polarized microscopy and from that took  
pictures of the light that passed through the polarizing plates and  
collagen. So since the color in my pictures is not due to a stain but  
due to light passing through collagen of different thickness, I think  
this plug in is of no help, unfortunately.

I am still trying to figure out how to get a % of red/orange and  
green/yellow that are in my pictures since mature collagen in  
red/orange and immature collagen is yellow/green.

If you have any further ideas or advice, please pass it on! I'm green  
behind the ears and am slowly getting discouraged.

Thanks very much,

Kate


Quoting "Stephan Saalfeld [via ImageJ]"  
<[hidden email]>:

>
>
>
> In the trivial case, that is when the intensity value stored for each
> color channel is linear, grey is ( red + green + blue ) / 3 and no color
> profiles are in the way, the conversion is quite easy.  Let r, g and b
> be red, green and blue in unsigned byte range [0...255] and calculate c,
> m, y and k as floating point in range [0...1]:
>
> c = 1.0 - r/255.0
> m = 1.0 - g/255.0
> y = 1.0 - b/255.0
>
> That's CMY from which CMYK is derived by extracting the grey component
> into a fourth channel and scaling the remaining color channels
> respectively:
>
> k = min( c, y, k )
> if ( k == 1.0 )
>   c = m = y = 0
> else
>   s = 1.0 - k
>   c = ( c - k ) / s
>   m = ( m - k ) / s
>   y = ( y - k ) / s
>
> For the application, you have in mind, I do not think that conversion
> into CMYK is of any help.  It does not add any information to your data.
> Better look at Gabriel Landini's Colour Deconvolution plugin and
> directly estimate the percentage of the colors you're looking for:
>
> http://www.dentistry.bham.ac.uk/landinig/software/cdeconv/cdeconv.html
>
> Best,
> Stephan
>
>
>
> On Thu, 2010-05-13 at 06:44 -0700, Kateo wrote:
>> HI Duane,
>> I was wondering if you could expand on how to convert RGB--> CMYK. I have no
>> clue about these things, but I found a paper that before analyzing the
>> colours in histological sections performed colour separation into CMYK
>> before dertermining the % of colours in their section. I want to determine
>> the % of orange/red vs. green colour in my sections stained with picrosirius
>> red and viewed under a polarized microscope. Anyway, I would appreciate your
>> guidance... or anyone else's!
>> Thanks,
>>
>> Kate
>
>
> ______________________________________
> View message @  
> http://imagej.588099.n2.nabble.com/RGB-to-CMYK-tp631553p5047771.html
>
> To unsubscribe from Re: RGB to CMYK, click  
> http://imagej.588099.n2.nabble.com/subscriptions/Unsubscribe.jtp?code=a2F0ZS5zYXVrc0B1dG9yb250by5jYXw1MDQ2MTczfC02OTIzNTgzNjg=
>



Reply | Threaded
Open this post in threaded view
|

Re: RGB to CMYK: threshold colour plugin

Jacqueline Ross
Hi Kate,

You could also try Gabriel Landini's other great plugin: Threshold
Colour (http://www.dentistry.bham.ac.uk/landinig/software/software.html
and
http://imagejdocu.tudor.lu/doku.php?id=plugin:color:threshold_colour:sta
rt ). This helps with separating out hues so might work quite well for
the colours you describe. I have some additional notes that I wrote for
our users that I could send you also if you are interested. They are
also available on our website.

Kind regards,

Jacqui

Jacqueline Ross

Biomedical Imaging Microscopist
Biomedical Imaging Research Unit
School of Medical Sciences
Faculty of Medical & Health Sciences
The University of Auckland
Private Bag 92019
Auckland, NEW ZEALAND

Tel: 64 9 373 7599 Ext 87438
Fax: 64 9 373 7484

http://www.fmhs.auckland.ac.nz/sms/biru/


-----Original Message-----
From: ImageJ Interest Group [mailto:[hidden email]] On Behalf Of
Kateo
Sent: Wednesday, 2 June 2010 6:07 a.m.
To: [hidden email]
Subject: Re: RGB to CMYK

HI Stephan,

Thank you very much for your reply! I appreciate your insight, and  
agree that perhaps I don't need to convert my image to CMYK.

I have tried using the color deconvoluter. However, I do not believe  
it will work with the type of images I am looking at. We stained them  
with picrosirius red to enhance the bifringency of collagen. We then  
looked at the slides under polarized microscopy and from that took  
pictures of the light that passed through the polarizing plates and  
collagen. So since the color in my pictures is not due to a stain but  
due to light passing through collagen of different thickness, I think  
this plug in is of no help, unfortunately.

I am still trying to figure out how to get a % of red/orange and  
green/yellow that are in my pictures since mature collagen in  
red/orange and immature collagen is yellow/green.

If you have any further ideas or advice, please pass it on! I'm green  
behind the ears and am slowly getting discouraged.

Thanks very much,

Kate


Quoting "Stephan Saalfeld [via ImageJ]"  
<[hidden email]>:

>
>
>
> In the trivial case, that is when the intensity value stored for each
> color channel is linear, grey is ( red + green + blue ) / 3 and no
color
> profiles are in the way, the conversion is quite easy.  Let r, g and b
> be red, green and blue in unsigned byte range [0...255] and calculate
c,

> m, y and k as floating point in range [0...1]:
>
> c = 1.0 - r/255.0
> m = 1.0 - g/255.0
> y = 1.0 - b/255.0
>
> That's CMY from which CMYK is derived by extracting the grey component
> into a fourth channel and scaling the remaining color channels
> respectively:
>
> k = min( c, y, k )
> if ( k == 1.0 )
>   c = m = y = 0
> else
>   s = 1.0 - k
>   c = ( c - k ) / s
>   m = ( m - k ) / s
>   y = ( y - k ) / s
>
> For the application, you have in mind, I do not think that conversion
> into CMYK is of any help.  It does not add any information to your
data.

> Better look at Gabriel Landini's Colour Deconvolution plugin and
> directly estimate the percentage of the colors you're looking for:
>
> http://www.dentistry.bham.ac.uk/landinig/software/cdeconv/cdeconv.html
>
> Best,
> Stephan
>
>
>
> On Thu, 2010-05-13 at 06:44 -0700, Kateo wrote:
>> HI Duane,
>> I was wondering if you could expand on how to convert RGB--> CMYK. I
have no
>> clue about these things, but I found a paper that before analyzing
the
>> colours in histological sections performed colour separation into
CMYK
>> before dertermining the % of colours in their section. I want to
determine
>> the % of orange/red vs. green colour in my sections stained with
picrosirius
>> red and viewed under a polarized microscope. Anyway, I would
appreciate your

>> guidance... or anyone else's!
>> Thanks,
>>
>> Kate
>
>
> ______________________________________
> View message @  
> http://imagej.588099.n2.nabble.com/RGB-to-CMYK-tp631553p5047771.html
>
> To unsubscribe from Re: RGB to CMYK, click  
>  (link removed) =
>




--
View this message in context:
http://imagej.588099.n2.nabble.com/RGB-to-CMYK-tp631553p5127308.html
Sent from the ImageJ mailing list archive at Nabble.com.