summary refs log tree commit diff
path: root/ppmcie.html
blob: 4d57b741e2bcf16922ad85bae1b6e4c7dbe9dc8a (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 3.2//EN">
<HTML><HEAD><TITLE>Ppmcie User Manual</TITLE></HEAD>
<BODY>
<H1>PPMCIE</H1>
Updated: July 31, 2005
<BR>
<A HREF="#index">Table Of Contents</A>

<A NAME="lbAB">&nbsp;</A>
<H2>NAME</H2>

ppmcie - draw a CIE color chart as a PPM image

<A NAME="lbAC">&nbsp;</A>
<H2>SYNOPSIS</H2>



<B>ppmcie</B>

[
<B>-rec709</B>|<B>-cie</B>|<B>-ebu</B>|<B>-hdtv</B>|<B>-ntsc</B>|<B>-smpte</B>
]
[<B>-xy</B>|<B>-upvp</B>]

[<B>-red</B> <I>rx</I> <I>ry</I>]

[<B>-green</B> <I>gx</I> <I>gy</I>]

[<B>-blue</B> <I>bx</I> <I>by</I>]

[<B>-white</B> <I>wx</I> <I>wy</I>]

[<B>-size</B> <I>edge</I>]

[{<B>-xsize</B>|<B>-width</B>} <I>width</I>]

[{<B>-ysize</B>|<B>-height</B>} <I>height</I>]

[<B>-noblack</B>]
[<B>-nowpoint</B>]
[<B>-nolabel</B>]
[<B>-noaxes</B>]
[<B>-full</B>]

<A NAME="lbAD">&nbsp;</A>
<H2>DESCRIPTION</H2>

<p>This program is part of <a href="index.html">Netpbm</a>.

<B>ppmcie</B> creates a PPM file containing a plot of the CIE
&quot;tongue&quot; color chart -- to the extent possible in a PPM
image.  Alternatively, creates a pseudo-PPM image of the color tongue
using RGB values from a color system of your choice.

<P>
The CIE color tongue is an image of all the hues that can be described
by CIE X-Y chromaticity coordinates.  They are arranged on a two
dimensional coordinate plane with the X chromaticity on the horizontal
axis and the Y chromaticity on the vertical scale.  (You can choose
alternatively to use CIE u'-v' chromaticity coordinates, but the
general idea of the color tongue is the same).

<P>
Note that the PPM format specifies that the RGB values in the file are
from the ITU-R Recommendation BT.709 color system, gamma-corrected.
And positive.  See <B><A HREF="ppm.html">ppm</A></B> for details.  If
you use one of the color system options on <B>ppmcie</B>, what you get
is not a true PPM image, but is very similar.  If you display such
<B>ppmcie</B> output using a device that expects PPM input (which
includes just about any computer graphics display program), it will
display the wrong colors.

<P>
However, you may have a device that expects one of these variations on 
PPM.

<P>
In every RGB color system you can specify, including the default
(which produces a true PPM image) there are hues in the color tongue
that can't be represented.  For example, monochromatic blue-green with 
a wavelength of 500nm cannot be represented in a PPM image.  

<P>
For these hues, <B>ppmcie</B> substitutes a similar hue as follows:
They are desaturated and rendered as the shade where the edge of the
Maxwell triangle intersects a line drawn from the requested shade to
the white point defined by the color system's white point.
Furthermore, unless you specify the <B>-full</B> option, <B>ppmcie</B>
reduces their intensity by 25% compared to the true hues in the image.

<P>
<B>ppmcie</B> draws and labels the CIE X-Y coordinate axes unless you
choose otherwise with options.

<P>
<B>ppmcie</B> draws the Maxwell triangle for the color system in use
on the color tongue.  The Maxwell triangle is the triangle whose
vertices are the primary illuminant hues for the color system.  The
hues inside the triangle show the color gamut for the color system.
They are also the only ones that are correct for the CIE X-Y
chromaticity coordinates shown.  (See explanation above).  <b>ppmcie</b>
denotes the Maxwell triangle by rendering it at full brightness, while
rendering the rest of the color tongue as 3/4 brightness.  You can turn
this off with options.

<P>
<B>ppmcie</B> also places a black cross at the color system's white
point (with the center of the cross open so you can actually see the
white color) and displays in text the CIE X-Y chromaticities of the
primary illuminants and white point for the color system.  You can
turn this off with options, though.

<P>
<B>ppmcie</B> annotates the periphery of the color tongue with the
wavelength, in nanometers of the monochromatic hues which appear
there.

<P>
<B>ppmcie</B> displays the black body chromaticity curve for Planckian
radiators from 1000 to 30000 kelvins on the image.  This curve traces the
colors of black bodies as various temperatures.

<P>
You can choose from several standard color systems, or specify one of
your own numerically.

<P>
CIE charts, by their very nature, contain a very large number of
colors.  If you're encoding the chart for a color mapped device or
file format, you'll need to use <B>pnmquant</B> or <B>ppmdither</B> to
reduce the number of colors in the image.

<A NAME="lbAE">&nbsp;</A>
<H2>OPTIONS</H2>

<p>You may abbreviate any option to its shortest unique prefix.

<DL COMPACT>
<DT><B>-rec709</B>
<DT><B>-cie</B>
<DT><B>-ebu</B>
<DT><B>-hdtv</B>
<DT><B>-ntsc</B>
<DT><B>-smpte</B>

<DD>
Select a standard color system whose gamut to plot.  The default is
<B>-rec709</B>, which chooses ITU-R Recommendation BT.709,
gamma-corrected.  This is the only color system for which
<B>ppmcie</B>'s output is a true PPM image.  See explanation above.
<B>-ebu</B> chooses the primaries used in the PAL and SECAM
broadcasting standards.  <B>-ntsc</B> chooses the primaries specified
by the NTSC broadcasting system (few modern monitors actually cover
this range).  <B>-smpte</B> selects the primaries recommended by the
Society of Motion Picture and Television Engineers (SMPTE) in
standards RP-37 and RP-145, and <B>-hdtv</B> uses the much broader
<I>HDTV ideal</I> primaries.  <B>-cie</B> chooses a color system that
has the largest possible gamut within the spectrum of the chart.  This
is the same color system as you get with the <B>-cie</B> option to
John Walker's <B>cietoppm</B> program.

<DT><B>-xy</B>

<DD>
plot CIE 1931 x y chromaticities.  This is the default.

<DT><B>-upvp</B>

<DD>
plot u' v' 1976 chromaticities rather than CIE 1931 x y
chromaticities.  The advantage of u' v' coordinates is that equal
intervals of distance on the u' v' plane correspond roughly to the
eye's ability to discriminate colors.

<DT><B>-red</B><I> rx ry</I>

<DD>
specifies the CIE <I>x</I> and <I>y</I> co-ordinates of the red
illuminant of a custom color system and selects the custom system.

<DT><B>-green</B><I> gx gy</I>

<DD>
specifies the CIE <I>x</I> and <I>y</I> co-ordinates of the green
illuminant of the color system and selects the custom system.

<DT><B>-blue</B><I> bx by</I>

<DD>
specifies the CIE <I>x</I> and <I>y</I> co-ordinates of the blue
illuminant of the color system and selects the custom system.

<DT><B>-white</B><I> wx wy</I>

<DD>
specifies the CIE <I>x</I> and <I>y</I> co-ordinates of the white
point of the color system and selects the custom system.

<DT><B>-size</B><I> edge</I>

<DD>
Create an image of <I>edge</I> by <I>edge</I> pixels.  The default is
512x512.

<DT><B>-xsize|-width</B><I> width</I>

<DD>
Sets the width of the generated image to <I>width</I> pixels.  The
default width is 512 pixels.  If the height and width of the image are
not the same, the CIE diagram will be stretched in the longer
dimension.

<DT><B>-ysize|-height</B><I> height</I>

<DD>
Sets the height of the generated image to <I>height</I> pixels.  The
default height is 512 pixels.  If the height and width of the image
are not the same, the CIE diagram will be stretched in the longer
dimension.

<DT><B>-noblack</B>

<DD>
Don't plot the black body chromaticity curve.

<DT><B>-nowpoint</B>

<DD>
Don't plot the color system's white point.

<DT><B>-nolabel</B>

<DD>
Omit the label.

<DT><B>-noaxes</B>

<DD>
Don't plot axes.

<DT><B>-full</B>

<DD>
Plot the entire CIE tongue in full brightness; don't dim the part
which is outside the gamut of the specified color system (i.e. outside
the Maxwell triangle).

</DL>

<h2 id="interpret">INTERPRETATION OF COLOR CHART</h2>

<p>A color spectrum is a linear combination of one or more monochromatic
colors.

<p>A color is a set of color spectra that all look the same to the
human eye (and brain).  Actually, for the purposes of the definition,
we assume the eye has infinite precision, so we can call two color
spectra different colors even though they're so close a person
couldn't possibly tell them apart.

<p>The eye contains 3 kinds of color receptors (cones).  Each has a
different response to the various monochromatic colors.  One kind
responds most strongly to blue, another red, another green.  Because
there are only three, many different color spectra will excite the
cones at exactly the same level, so the eye cannot tell them apart.
All such spectra that excite the cones in the same way are a single
color.

<p>Each point in the color tongue represents a unique color.  But
there are an infinite number of color spectra in the set that is that
color; i.e. an infinite number of color spectra that would look to you
like this point.  A machine could tell them apart, but you could not.

<p>Remember that the colors outside the highlighted triangle are
approximations of the real colors because the PPM format cannot
represent them (and your display device probably cannot display them).
That is, unless you're using a variation of PPM and a special display
device, as discussed earlier in this manual.

<p>A color is always relative to some given maximum brightness.  A
particular beam of light looks lime green if in a dim field, but
pea green if in a bright field.  An image on a movie screen may
look pitch black because the projector is not shining any light on
it, but when you turn off the projector and look at the same spot in
room light, the screen looks quite white.  The same light from that spot
hit your eye with the project on as with it off.

<p>The chart shows two dimensions of color.  The third is intensity.
All the colors in the chart have the same intensity.  To get all
possible colors in the gamut, Make copies of the whole chart at every
intensity between zero and the maximum.

<p>The edge of the tongue consists of all the monochromatic colors.
A monochromatic color is one with a single wavelength.  I.e. a color
that is in a rainbow.  The numbers you see are the wavelengths in
nanometers.

<p>Any straight line segment within the tongue contains colors which
are linear combinations of two colors -- the colors at either end of
the line segment.

<p>Any color in the chart can be created from two other colors (actually,
from any of an infinite number of pairs of other colors).

<p>All the colors within a triangle inside the tongue can be created
from a linear combination of the colors at the vertices of that triangle.

<p>Any color in the tongue can be created from at most 3 monochromatic
colors.

<p>The highlighted triangle shows the colors that can be expressed
in the tristimulus color system you chose.  (ITU-R BT.709 by default).
The corners of the triangle are the 3 primary illuminants in that
system (a certain red, green, and blue for BT.709).  The edges of
the triangle, then, represent the colors you can represent with two
of the primary illuminants (saturated colors), and the interior colors
require all three primary illuminants (are not saturated).

<p>In the ITU-R BT.709 color system (the default), the white point is
defined as D65, which is (and is named after) the color of a black
body at 6502 kelvins.  Therefore, you should see the temperature curve
on the image pass through the white part of the image, and the cross
that marks the white point, at 6502 kelvins.

<p>D65 white is supposed to be the color of the sun.  If you have a
perfect BT.709 display device, you should see the color of the sun
at the white point cross.  That's an important color, because when you
look at an object in sunlight, the color that reflects of the object
is based on the color of sunlight.  Note that the sun produces a
particular color spectrum, but many other color spectra are the same
color, and display devices never use the actual color spectrum of the
sun.

<p>The colors at the corners of the triangle have the chromaticities
phosphors in a monitor that uses the selected color system.  Note
that in BT.709 they are very close to monochromatic red, green,
and blue, but not quite.  That's why you can't display even one true
color of the rainbow on a video monitor.

<p>Remember that the chart shows colors of constant intensity,
therefore the corners of the triangles are not the full colors of the
primary illuminants, but only their chromaticities.  In fact, the
illuminants typically have different intensities.  In BT.709, the
blue primary illuminant is far more intense than the green, which is
more intense than the red.  Designers did this in order to make an
equal combination of red, green, and blue generate gray.  I.e.  a
combination of full strength red, full strength green, and full
strength blue BT.709 primary illuminants is D65 white.

<p>The tongue has a sharp straight edge at the bottom because that's
the limit of human vision.  There are colors below that line, but they
involve infrared and ultraviolet light, so you can't see them.  This
line is called the &quot;line of purples.&quot;



<A NAME="lbAF">&nbsp;</A>
<H2>SEE ALSO</H2>

<B><A HREF="ppmdither.html">ppmdither</A></B>,
<B><A HREF="pnmquant.html">pnmquant</A></B>,
<B><A HREF="ppm.html">ppm</A></B>

<A NAME="lbAG">&nbsp;</A>
<H2>AUTHOR</H2>

<p>
Copyright (C) 1995 by John Walker (<A
HREF="mailto:kelvin@fourmilab.ch">kelvin@fourmilab.ch</A>)

<p>
WWW home page: <A
HREF="http://www.fourmilab.ch/">http://www.fourmilab.ch/</A>

<P>
Permission to use, copy, modify, and distribute this software and its
documentation for any purpose and without fee is hereby granted,
without any conditions or restrictions.  This software is provided as
is without express or implied warranty.

<HR>
<A NAME="index">&nbsp;</A>
<H2>Table Of Contents</H2>
<UL>
<LI><A HREF="#lbAB">NAME</A>
<LI><A HREF="#lbAC">SYNOPSIS</A>
<LI><A HREF="#lbAD">DESCRIPTION</A>
<LI><A HREF="#lbAE">OPTIONS</A>
<LI><A HREF="#interpretation">INTERPRETATION OF COLOR CHART</A>
<LI><A HREF="#lbAF">SEE ALSO</A>
<LI><A HREF="#lbAG">AUTHOR</A>
</UL>
</BODY>
</HTML>