You are viewing a plain text version of this content. The canonical link for it is here.
Posted to fop-dev@xmlgraphics.apache.org by "Peter B. West" <pb...@powerup.com.au> on 2001/11/19 06:09:56 UTC

Question about colour

I have some questions about the handling of colour which I will ask of 
the list generally, although I noticed Tore's recent colour related 
contributions, so he may be the one to enlighten me.

Color (to use the official spelling) is one of those areas of the spec 
whose precise description is deferred to other documents, so I am hoping 
someone on the list has done all of the hard work.  In 
.../datatypes/ColorType.java the ColorType is defined as a set of 
floating point numbers: red, green, blue and alpha.  From the code, it 
is apparent that the RGB components are in the range 0 to 1.0.

Is this also true of alpha?

Why this particular representation?  Is it mandated in the sRGB 
document, or is it the representation used by PDF?

What is a color profile?  In the recently updated (by Tore) 
ColorSpace.java, it is represented as a byte array.  What is the 
function of this byte array?

What is the relationship between the the linear RGB space and sRGB, 
which, from my glance at the document, seems to involve a color profile, 
and between the sRGB and the ICC color profiles?

All information will be gratefully received.

Peter
-- 
Peter B. West  pbwest@powerup.com.au  http://powerup.com.au/~pbwest
"Lord, to whom shall we go?"


---------------------------------------------------------------------
To unsubscribe, e-mail: fop-dev-unsubscribe@xml.apache.org
For additional commands, email: fop-dev-help@xml.apache.org


Re: Question about colour

Posted by Ulrich Mayring <ul...@denic.de>.
Tore Engvig wrote:
> 
> The short version is that a color profile is errr, a color profile :)
> The point is to make color handling consistent. Let's assume that you have a
> calibrated system (you must have a calibrated system if it should be any
> point).
> Then you scan an image, edit it in photoshop and sends it to a printer. All
> those devices (your scanner, screen and printer) probably have different
> color profiles and by embedding an icc profile you ensure (well, almost)
> that what you see on the screen is the same that comes out of your printer).

Here's some basics about ICC profiles:

You can embed an ICC profile into your image. The embedded profile tells
the recipient of the image about the device used to create the image,
e.g. the scanner. If you're using Photoshop (or another ICC-enabled
tool) to view the image, then you can define your desired output device
(by pointing Photoshop to the output device's ICC profile). You also
point Photoshop to a profile of your screen. Then Photoshop can take all
three profiles into account and display the image correctly on your
screen. Correctly in this case means the way it would look, when printed
to the specified output device.

So, an ICC profile is a description of the color space of some kind of
input, display or output device. Here's how you create profiles:

1) Print an ICC testchart (consists of many color patches) to your
output device.
2) Use an expensive hardware device to measure the print.
3) Use an expensive software to read in the measured values and compare
them to the actual values in the testchart file.
4) Tell the expensive software to encode the differences in an ICC
profile.

In the case of a monitor profile, there's a different type of expensive
hardware device to measure the colors and you don't print the testchart,
you display it on the screen. Finally, to get "round-trip" color safety,
you can scan the printed ICC testchart with your scanner to calculate a
profile for your scanner.

Apart from embedding ICC profiles into images (or, for that matter, PDF
or PostScript files), there's many other use cases for ICC color
management technology, which probably are not relevant to fop at this
time, so I'll leave that out for the moment.

> sRGB is a limited color space, there are a lot of colors you can't express
> in sRGB. E.g. pastel colors can be described in CMYK but not in RGB.

sRGB is almost useless for any kind of serious color management. It may
be good enough for "office-use", even though I doubt it would do a
secretary any good either. There is no RGB standard out there, period.
The only one that makes sense from a technical point of view and has
some distribution is Adobe RGB. It's proprietary, of course, but it's
good quality. Generally it's not that bad to use proprietary color
spaces, because it has no consequences for your application. Internally
every application should work with the LAB color space, which includes
all colors known to man and is an accepted international standard (CIE
being the standards body in this area). If your app works with LAB
internally, then other color spaces like Adobe RGB or SWOP CMYK are just
bytes you read in or write out.

> My knowledge about these things is limited but if you ask someone in the
> press industry they can lecture you hours about problems with reproducing
> colors (just don't belive everything they say about CMYK - it's not that
> great :)

CMYK sucks, but it beats sRGB any day. This is a real shame, because RGB
in general is a much larger color space - and no computer monitor I know
of is limited to sRGB colors.

Ulrich

-- 
Ulrich Mayring
DENIC eG, Systementwicklung

---------------------------------------------------------------------
To unsubscribe, e-mail: fop-dev-unsubscribe@xml.apache.org
For additional commands, email: fop-dev-help@xml.apache.org


RE: Question about colour

Posted by Tore Engvig <te...@manamind.com>.

> -----Original Message-----
> From: Peter B. West [mailto:pbwest@powerup.com.au]

> I have some questions about the handling of colour which I will ask of
> the list generally, although I noticed Tore's recent colour related
> contributions, so he may be the one to enlighten me.
>
> Color (to use the official spelling) is one of those areas of the spec
> whose precise description is deferred to other documents, so I am hoping
> someone on the list has done all of the hard work.

hehe, unfortunately I haven't done all the hard work, but can give you some
pointers.

> In
> .../datatypes/ColorType.java the ColorType is defined as a set of
> floating point numbers: red, green, blue and alpha.  From the code, it
> is apparent that the RGB components are in the range 0 to 1.0.
>
> Is this also true of alpha?

yes

> Why this particular representation?  Is it mandated in the sRGB
> document, or is it the representation used by PDF?

I don't think it's mandated by sRGB but the representation is used in PDF.

> What is a color profile?  In the recently updated (by Tore)
> ColorSpace.java, it is represented as a byte array.  What is the
> function of this byte array?

You can find a lot of information about ICC profiles at
http://www.color.org/

The short version is that a color profile is errr, a color profile :)
The point is to make color handling consistent. Let's assume that you have a
calibrated system (you must have a calibrated system if it should be any
point).
Then you scan an image, edit it in photoshop and sends it to a printer. All
those devices (your scanner, screen and printer) probably have different
color profiles and by embedding an icc profile you ensure (well, almost)
that what you see on the screen is the same that comes out of your printer).

The byte array used in ColorSpace.java is the embedded icc profile in the
jpeg and it's sent directly to the pdf. This is just a support for icc
profiles in jpegs (which could easily be extended to other image formats),
but if we should provide full support for the fo:color-profile element a lot
more work needs to be done.

> What is the relationship between the the linear RGB space and sRGB,
> which, from my glance at the document, seems to involve a color profile,
> and between the sRGB and the ICC color profiles?

sRGB (Standard RGB) was defined by HP, Microsoft and Pantone in '97 (unless
my memory fails me...) and is the standard color space from html 3.2 and css
1.0
You can find a lot info about sRGB if you search for e.g. "Standard RGB
sRGB" on google. Among the hits are:

http://www.color.org/sRGB.html
http://www.w3.org/Graphics/Color/sRGB.html

sRGB is a limited color space, there are a lot of colors you can't express
in sRGB. E.g. pastel colors can be described in CMYK but not in RGB.

My knowledge about these things is limited but if you ask someone in the
press industry they can lecture you hours about problems with reproducing
colors (just don't belive everything they say about CMYK - it's not that
great :)


Tore


>
> All information will be gratefully received.
>
> Peter
> --
> Peter B. West  pbwest@powerup.com.au  http://powerup.com.au/~pbwest
> "Lord, to whom shall we go?"
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: fop-dev-unsubscribe@xml.apache.org
> For additional commands, email: fop-dev-help@xml.apache.org
>
>


---------------------------------------------------------------------
To unsubscribe, e-mail: fop-dev-unsubscribe@xml.apache.org
For additional commands, email: fop-dev-help@xml.apache.org