## How to convert "Red/Green/Blue" to "Red/Yellow/Blue" color mix

### How to convert "Red/Green/Blue" to "Red/Yellow/Blue" color mix

Anyone knows how to convert Red/Green/Blue (i.e. prime color of light)
to Red/Yellow/Blue (.e. prime color for paint materials and printer's
ink) ?

I want to write a painter program that allow user to mix color of Red,
Yellow, Blue.  The conversion routine is necessary.
--
Peter Liu

Hong Kong

### How to convert "Red/Green/Blue" to "Red/Yellow/Blue" color mix

convert from the screen display (additive system : Red-Green-Blue) to printing
(substractive system: should really be Magenta-Yellow-Cyan)

Well, try this (or a similar digital version involving multiplying by 256 etc)

Magenta = 1 - fraction of Green and Blue
Yellow = 1 - fraction of red +blue
Cyan = 1- fraction of green + red

You will find that the contrast/shade would be a bit strange and you will have to
satuation of paints and their actual shades, the logorithmic sensitivity of
the eye etc). To adjust the gamma ( it is called "gamma" in most display/image
processing situations, but I think it refers to "gain"  or something)

Try this algorithm; 0 < values < 1

New value = (old value) to the power some number.

The simple algorthm keeps the end points unchanged but shifts the middle up and
down depending on the power ( less than one or more than one). A value of either
0.5 or 2 should be sensible - don't know which way.

Good luck.

|> > Anyone knows how to convert Red/Green/Blue (i.e. prime color of light)
|> > to Red/Yellow/Blue (.e. prime color for paint materials and printer's
|> > ink) ?
|> >
|> > I want to write a painter program that allow user to mix color of Red,
|> > Yellow, Blue.  The conversion routine is necessary.
|> You mean CMYK ????
|>
|> Regds
|> LAM Chi-fung
|> ------------------------------------------------------------------------------
|> PC Game Cheat & Info list maintainer

|> ------------------------------------------------------------------------------

### How to convert "Red/Green/Blue" to "Red/Yellow/Blue" color mix

Actually, I mean Red/Yellow/Blue, not CMYK.

Conversion from RGB to CMYK is nothing new.

What I want is conversion from RGB to Red/Yellow/Blue, the primary
colors for paint materials used by artists.

> Anyone knows how to convert Red/Green/Blue (i.e. prime color of light)
> to Red/Yellow/Blue (.e. prime color for paint materials and printer's
> ink) ?

> I want to write a painter program that allow user to mix color of Red,
> Yellow, Blue.  The conversion routine is necessary.
> --
> Peter Liu

>        Hong Kong

--
Peter Liu

Hong Kong

### How to convert "Red/Green/Blue" to "Red/Yellow/Blue" color mix

Quote:> Anyone knows how to convert Red/Green/Blue (i.e. prime color of light)
> to Red/Yellow/Blue (.e. prime color for paint materials and printer's
> ink) ?

> I want to write a painter program that allow user to mix color of Red,
> Yellow, Blue.  The conversion routine is necessary.

You mean CMYK ????

Regds
LAM Chi-fung
------------------------------------------------------------------------------
PC Game Cheat & Info list maintainer

------------------------------------------------------------------------------

### How to convert "Red/Green/Blue" to "Red/Yellow/Blue" color mix

> Actually, I mean Red/Yellow/Blue, not CMYK.

> Conversion from RGB to CMYK is nothing new.

> What I want is conversion from RGB to Red/Yellow/Blue, the primary
> colors for paint materials used by artists.

It's not possible:

R:255
G:255
B:255

has no R/Y/B equiv, you'll have to add white paint, and to get black
from R/Y/B is nearly impossible.

--
- As far as anybody knows, I have a nice, normal mind...

### How to convert "Red/Green/Blue" to "Red/Yellow/Blue" color mix

>Actually, I mean Red/Yellow/Blue, not CMYK.
>Conversion from RGB to CMYK is nothing new.
>What I want is conversion from RGB to Red/Yellow/Blue, the primary
>colors for paint materials used by artists.

You're talking computers program, which means additive colors. Since
Yellow is Red + Green, this means than the following conversions have

RGB -> RYB

Red -> Red
Red+Green -> Yellow
Blue -> Blue

and converting back: RYB -> RGB

Red -> Red
Yellow-Red -> Green
Blue -> Blue

Sounds fairly logical to me.
Eric van Orsouw

### How to convert "Red/Green/Blue" to "Red/Yellow/Blue" color mix

[...]

Quote:>> What I want is conversion from RGB to Red/Yellow/Blue, the primary
>> colors for paint materials used by artists.

>It's not possible:

>R:255
>G:255
>B:255

>has no R/Y/B equiv, you'll have to add white paint, and to get black
>from R/Y/B is nearly impossible.

If you assume white paper (the usual), then
RGB(255,255,255) ==> RYB(0,0,0)
And black is all colors subtracted, so it's RYB(255,255,255) (or the
equivalent largest values in whatever system you're using).-Wm

### How to convert "Red/Green/Blue" to "Red/Yellow/Blue" color mix

>What I want is conversion from RGB to Red/Yellow/Blue, the primary
>colors for paint materials used by artists.

Red, yellow and blue are not orthogonal, so any colour space created
from these threee colours would not include all possible colours.
Since you are talking about painting I assume you are talking about
subtractive colour (mixing paints). With these paint colours it is
impossible to get cyan or magenta. I think you will find artists often
use more than just those three colours.

What you could do is work in CMY (which is 255-R, 255-G, 255-B) and
the amounts selected to get the CMY colour.

love Panther
---

http://www.pinkboard.com.au/People/Panther.html
"Do you like boys or girls? It's so confusing these days."

### How to convert "Red/Green/Blue" to "Red/Yellow/Blue" color mix

>> Actually, I mean Red/Yellow/Blue, not CMYK.

>> Conversion from RGB to CMYK is nothing new.

>> What I want is conversion from RGB to Red/Yellow/Blue, the primary
>> colors for paint materials used by artists.

>It's not possible:

>R:255
>G:255
>B:255

>has no R/Y/B equiv, you'll have to add white paint, and to get black
>from R/Y/B is nearly impossible.

It may not be possible to go to a RYB color space, since it may not have
been invented.  But that may not be what the original poster really
wants to do.

If I was attempting to do this, I would use the HIS (Hue, Intensity,
Saturation) conversions to/from RGB.  Once you are in the HIS color space,
you can determine the color tint from the Hue component.  A good book to
use for a reference (equations, explanations, etc...) is called:

Title: Raster Graphics Handbook
Author: Conrac Corporation
Publisher: Van Nostrand Reinhold Company

Although I'm certainly not an expert in this area, its seems as though
all your paint mixing and assignment of stock and custom colors could
be made in HIS color space.  There might also be a standard assignment
of colors that you could use.  I've seen references to Pantone color
charts in some programs.  They might already have specific HIS color
specifications.

John Anderson
Algorithm Engineering

### How to convert "Red/Green/Blue" to "Red/Yellow/Blue" color mix

: Cookie Monster [Glenn Fisher]) writes:
: >

: [...]
: >> What I want is conversion from RGB to Red/Yellow/Blue, the primary
: >> colors for paint materials used by artists.
: >
: >It's not possible:
: >
: >R:255
: >G:255
: >B:255
: >
: >has no R/Y/B equiv, you'll have to add white paint, and to get black
: >from R/Y/B is nearly impossible.

: If you assume white paper (the usual), then
:     RGB(255,255,255) ==> RYB(0,0,0)
: And black is all colors subtracted, so it's RYB(255,255,255) (or the
: equivalent largest values in whatever system you're using).-Wm

The impossible colours to get are things such as CYAN and MAGENTA. You
can't get those with RYB as your paints. [eg Mixing R and B will give you
a murkey dark magenta, not pure magenta.]

Now what has this to do with comp.unix.programer? Don't ask me.

--

Philips Semiconductors Ltd
Southampton                                 My views are my own.
United Kingdom
Are you using ISO8859-1? Do you see ? as copyright, as division and ? as 1/2?

### How to convert "Red/Green/Blue" to "Red/Yellow/Blue" color mix

Quote:>>It's not possible:

snip

Quote:>If you assume white paper (the usual), then
>    RGB(255,255,255) ==> RYB(0,0,0)
>And black is all colors subtracted, so it's RYB(255,255,255) (or the
>equivalent largest values in whatever system you're using).-Wm

The first statment is not correct, it is possible to convert RGB to other formats.
Most standard conversion/output systems support only light color systems RGB and CMYK:

white = Red=255,Green=255,Blue=255              (RGB)
white = Cyan=0,Magenta=0,Yellow=0,Black=0       (CMYK)

These are used because computer monitors and colour filmwork use a light source.

The three primary colours for artists is a subtractive color system.
Paint only reflects light so the way each color mix is created is totally different.

Although CMYK is a subtractive system, it is merely an inversion of the RGB system and is
still used for light.e.g.

Red = {R=255,G=0,B=0} = {C=0,M=255,Y=255,B=0}

When a light source has a magenta filter placed in front of it, red & blue light passes
through. When a yellow filter is used, red and green light is passes through. When both
filters are used, blue light is blocked by the yellow filter and green light is blocked
by the magenta filter, only red light passes through.

Magenta paint reflects red & blue light, yellow paint reflects red & green light. When
magenta and yellow paint is mixed, some blue and some green is still reflected along with
the red light and the color is not true.

Are you attempting to duplicate milticolor artwork, for the printing industry, in a
screenprinting(or other paint based) system?

The inks printers use are unlike paint as they are a FILTER for the white light reflected
from the page.

You will need to work out your own conversion system to convert palettes.

hope this helps.

Jeff

Stealthy Kiwi

"My opinion is my own (unless someone else thought of it first)"
<<<<<<<<<<<<<<<<<<<<>>>>>>>>>>>>>>>>>>>>
by me and does not represent or purport
to represent the Fisher & Paykel Group
or any of its subsidiaries in any way.
<<<<<<<<<<<<<<<<<<<<>>>>>>>>>>>>>>>>>>>>

Hi,

Does anyone know why

struct servent *serv;
serv=getservbyname("exec","tcp");

gives a warning err of incomparible pointer type?

I also can't get rexec to function. It compiles ok....

Thanks

Kirk