summaryrefslogtreecommitdiff
path: root/graphics/pstricks/contrib/pst-cie/doc/pst-cie-doc.tex
blob: a90912ca0c197069c9d7b7a91a5eb5a583824339 (plain)
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
%% $Id: pst-cie-doc.tex 531 2017-08-24 07:59:27Z herbert $
\documentclass[11pt,english,BCOR10mm,DIV12,bibliography=totoc,parskip=false,smallheadings,
    headexclude,footexclude,oneside]{pst-doc}
\listfiles

\usepackage[utf8]{inputenc}
\usepackage{pst-cie}
\let\pstFV\fileversion
\def\bgImage{\resizebox{7cm}{!}{\begin{pspicture}(-1,-1)(8.5,11)
\psChromaticityDiagram[Planck,bgcolor=yellow!100!black!20,textcolor=black!70,ColorSpace=Pal-Secam]
\rput(5.5,8){\textbf{Pal-Secam}}
\end{pspicture}}}
\lstset{explpreset={pos=l,width=-99pt,overhang=0pt,hsep=\columnsep,vsep=\bigskipamount,rframe={}}}
\usepackage{biblatex}
\addbibresource{\jobname.bib}

\def\tabCIE{%
\begin{tabular}{|c|c|c|c|c|}
\cline{2-5} \multicolumn{1}{c|}{} & Red      & Green   & Blue  & White \\\hline
x&0.7355&0.2658&0.1669&0.3333\\\hline
y&0.2645&0.7243&0.0085&0.3333\\\hline
\end{tabular}%
}
\def\tabsRGB{%
\begin{tabular}{|c|c|c|c|c|}\cline{2-5} 
\multicolumn{1}{c|}{} & Red      & Green   & Blue  & White \\\hline
x&0.6400&0.3000&0.1500&0.3127\\\hline
y&0.3300&0.6000&0.0600&0.3290\\\hline
\end{tabular}%
}
\def\tabSMPTE{%
\begin{tabular}{|c|c|c|c|c|}\cline{2-5} 
\multicolumn{1}{c|}{} & Red      & Green   & Blue  & White \\\hline
x&0.6300&0.3100&0.1500&0.3127\\\hline
y&0.3400&0.5950&0.0700&0.3290\\\hline
\end{tabular}%
}
\def\tabAdobe{%
\begin{tabular}{|c|c|c|c|c|}\cline{2-5} 
\multicolumn{1}{c|}{} & Red      & Green   & Blue  & White \\\hline
x&0.6400&0.2100&0.1500&0.3127\\\hline
y&0.3300&0.7150&0.0600&0.3290\\\hline
\end{tabular}%
}
\def\tabColorMatch{%
\begin{tabular}{|c|c|c|c|c|}\cline{2-5} 
\multicolumn{1}{c|}{} & Red      & Green   & Blue  & White \\\hline
x&0.6300&0.2950&0.1500&0.3457\\\hline
y&0.3400&0.6050&0.0750&0.3585\\\hline
\end{tabular}%
}
\def\tabProPhoto{%
\begin{tabular}{|c|c|c|c|c|}\cline{2-5} 
\multicolumn{1}{c|}{} & Red      & Green   & Blue  & White \\\hline
x&0.7347&0.1596&0.0366&0.3457\\\hline
y&0.2653&0.8404&0.0001&0.3585\\\hline
\end{tabular}%
}
\def\tabPal-Secam{%
\begin{tabular}{|c|c|c|c|c|}\cline{2-5} 
\multicolumn{1}{c|}{} & Red      & Green   & Blue  & White \\\hline
x&0.6400&0.2900&0.1500&0.3127\\\hline
y&0.3300&0.6000&0.0600&0.3290\\\hline
\end{tabular}%
}
\def\tabNTSC{%
\begin{tabular}{|c|c|c|c|c|}\cline{2-5} 
\multicolumn{1}{c|}{} & Red      & Green   & Blue  & White \\\hline
x&0.6700&0.2100&0.1400&0.3101\\\hline
y&0.3300&0.7100&0.0800&0.3162\\\hline
\end{tabular}%
}

\begin{document}
\title{\texttt{pst-cie}: CIE xy chromaticity space\\
\small v.\pstFV}
%\docauthor{}
\author{Manuel Luque\\Herbert Voß}
\maketitle


\section{Introduction}


Using data (CIE XYZ CIE XYZ 1931 and 1964)
from the International Commission on Illumination (Commission internationale de l’éclairage)
the package \LPack{pst-cie}  proposes to represent the color table and / or the chromaticity diagram for 
different color spaces. Web page devoted to studies and performances diagrams and chromaticity 
tables are numerous and it is difficult to distinguish one over another, 
however here are some important informations:  
\href{http://www.f-legrand.fr/scidoc/docmml/index.html}{Frédéric Legrand} 
devoted to colorimetry, and those of Daniel Metz. Yu-Chang Sung realized with the software 
\textsf{Mathematica} an interactive version of beauty: 
\href{http://demonstrations.wolfram.com/CIEChromaticityDiagram/}{CIEChromaticityDiagram}
as I do not own this software I tried to do pretty much the same with PSTricks, or at least 
having almost the same functionality.

The macro \Lcs{psChromaticityDiagram}\OptArgs supports the following optional arguments:

\bigskip
% \small\let\tbs\textbackslash
\newcommand*\titretab[1]{\multicolumn{1}{c}{\emph{#1}}}
\noindent
\begin{tabularx}{\linewidth}{@{}l>{\ttfamily}llX@{}}
  \toprule
  \titretab{Option} & \titretab{Type} & \titretab{Default}
& \titretab{Description}
\\\toprule
\Lkeyword{gamma}      & number   &2.2 & color correction\\
\Lkeyword{contrast} &number   &1  & 0<contrast<=1 \\
\Lkeyword{ColorSpace}        &name  & sRGB & colorspace \\
\Lkeyword{datas}        &name  &CIE1931 & CIE\\
\Lkeyword{primaries} &boolean & true & show primary points\\
\Lkeyword{trianglecolor}   & color & black & color of the triangle \\
\Lkeyword{bgcolor}   & color & black & background color \\
\Lkeyword{textcolor} & color & white & textcolor \\
\Lkeyword{Planck} & boolean & false & draw the Planck' locus \\ 
\Lkeyword{showcontour} & boolean & false & \sloppy show the contour of the color space, only useful for using \Lcs{pstPlanck}.\\
\Lkeyword{Tfontsize} & length & 4pt & fontsize for the temperature of the Planck curve\\
\Lkeyword{unit}      & number & 1 & unit depending to the default size of 10cm$\times$10cm\\
\Lkeyword{PSfont}    & PS font & Helvetica-Bold & \\
\Lkeyword{fontscale} & 5 & PS font scale in pt\\
\bottomrule
\end{tabularx}

\bigskip
The color spaces which are available are: \Lkeyval{Adobe}, 
\Lkeyval{CIE}, 
\Lkeyval{ColorMatch}, 
\Lkeyval{NTSC}, 
\Lkeyval{Pal-Secam}, 
\Lkeyval{ProPhoto}, 
\Lkeyval{SMPTE}, and 
\Lkeyval{sRGB}.

Tabulated values available are those of the CIE XYZ 1931 and the CIE XYZ 1964.
A low value of the contrast will highlight the work area of 
the system displayed the colors it can represent, it is the triangle 
with vertices the points of primary colors included in the 
\emph{Iron horse} which represents all the colors visible to the human eye.


\section{Examples}
\begin{center}
\begin{pspicture}(-1,-1)(8.5,11)
\psChromaticityDiagram
\rput(5.5,8){\white \textbf{Colorspace sRGB}}
\rput(4,10){\tabsRGB}
\end{pspicture}

\begin{verbatim}
\begin{pspicture}(-1,-1)(8.5,11)
\psChromaticityDiagram
\rput(5.5,8){\white \textbf{Colorspace sRGB}}
\rput(4,10){\tabsRGB}
\end{pspicture}
\end{verbatim}
\end{center}




\begin{center}
\begin{pspicture}(-1,-1)(8.5,11)
\psChromaticityDiagram[Planck,trianglecolor=black]
\rput(5.5,8){\white \textbf{Colorspace sRGB}}
\rput(4,10){\tabsRGB}
\end{pspicture}

\begin{verbatim}
\begin{pspicture}(-1,-1)(8.5,11)
\psChromaticityDiagram[Planck,trianglecolor=black]
\rput(5.5,8){\white \textbf{Colorspace sRGB}}
\rput(4,10){\tabsRGB}
\end{pspicture}
\end{verbatim}
\end{center}

\begin{center}
\begin{pspicture}(-1,-1)(8.5,11)
\psChromaticityDiagram[datas=CIE1964,ColorSpace=Adobe,contrast=0.1]
\rput(5.5,8){\white \textbf{Colorspace Adobe}}
\rput(4,10){\tabAdobe}
\end{pspicture}

\begin{verbatim}
\begin{pspicture}(-1,-1)(8.5,11)
\psChromaticityDiagram[datas=CIE1964,ColorSpace=Adobe,contrast=0.1]
\rput(5.5,8){\white \textbf{Colorspace Adobe}}
\rput(4,10){\tabAdobe}
\end{pspicture}
\end{verbatim}


\begin{pspicture}(-1,-1)(8.5,11)
\psChromaticityDiagram[Planck,bgcolor=black!40,datas=CIE1964,
                       ColorSpace=Adobe,contrast=0.1]
\rput(5.5,8){\white \textbf{Colorspace Adobe}}
\rput(4,10){\tabAdobe}
\end{pspicture}

\begin{verbatim}
\begin{pspicture}(-1,-1)(8.5,11)
\psChromaticityDiagram[Planck,bgcolor=black!40,datas=CIE1964,
                       ColorSpace=Adobe,contrast=0.1]
\rput(5.5,8){\white \textbf{Colorspace Adobe}}
\rput(4,10){\tabAdobe}
\end{pspicture}
\end{verbatim}


\end{center}

\begin{center}
\begin{pspicture}(-1,-1)(8.5,11)
\psChromaticityDiagram[ColorSpace=ProPhoto,contrast=0.1]
\rput(5.5,8){\white \textbf{Colorspace ProPhoto}}
\rput(4,10){\tabProPhoto}
\end{pspicture}

\begin{verbatim}
\begin{pspicture}(-1,-1)(8.5,11)
\psChromaticityDiagram[ColorSpace=ProPhoto,contrast=0.1]
\rput(5.5,8){\white \textbf{Colorspace ProPhoto}}
\rput(4,10){\tabProPhoto}
\end{pspicture}
\end{verbatim}
\end{center}

\begin{center}
\begin{pspicture}(-1,-1)(8.5,11)
\psChromaticityDiagram[ColorSpace=ColorMatch,contrast=0.1]
\rput(5.5,8){\white \textbf{Colorspace ColorMatch}}
\rput(4,10){\tabColorMatch}
\end{pspicture}

\begin{verbatim}
\begin{pspicture}(-1,-1)(8.5,11)
\psChromaticityDiagram[ColorSpace=ColorMatch,contrast=0.1]
\rput(5.5,8){\white \textbf{Colorspace ColorMatch}}
\rput(4,10){\tabColorMatch}
\end{pspicture}
\end{verbatim}
\end{center}

\begin{center}
\begin{pspicture}(-1,-1)(8.5,11)
\psChromaticityDiagram[ColorSpace=NTSC,contrast=0.1]
\rput(5.5,8){\white \textbf{Colorspace NTSC}}
\rput(4,10){\tabNTSC}
\end{pspicture}

\begin{verbatim}
\begin{pspicture}(-1,-1)(8.5,11)
\psChromaticityDiagram[ColorSpace=NTSC,contrast=0.1]
\rput(5.5,8){\white \textbf{Colorspace NTSC}}
\rput(4,10){\tabNTSC}
\end{pspicture}
\end{verbatim}
\end{center}

\begin{center}
\begin{pspicture}(-1,-1)(8.5,11)
\psChromaticityDiagram[ColorSpace=CIE]
\rput(5.5,8){\white \textbf{Colorspace CIE}}
\rput(4,10){\tabCIE}
\end{pspicture}

\begin{verbatim}
\begin{pspicture}(-1,-1)(8.5,11)
\psChromaticityDiagram[ColorSpace=CIE]
\rput(5.5,8){\white \textbf{Colorspace CIE}}
\rput(4,10){\tabCIE}
\end{pspicture}
\end{verbatim}
\end{center}

\begin{center}
\begin{pspicture}(-1,-1)(8.5,11)
\psChromaticityDiagram[ColorSpace=Pal-Secam]
\rput(5.5,8){\white \textbf{Colorspace Pal-Secam}}
\rput(4,10){\tabPal-Secam}
\end{pspicture}

\begin{verbatim}
\begin{pspicture}(-1,-1)(8.5,11)
\psChromaticityDiagram[ColorSpace=Pal-Secam]
\rput(5.5,8){\white \textbf{Colorspace Pal-Secam}}
\rput(4,10){\tabPal-Secam}
\end{pspicture
\end{verbatim}


\begin{pspicture}(-1,-1)(8.5,11)
\psChromaticityDiagram[bgcolor=yellow!100!black!20,textcolor=black!70,ColorSpace=Pal-Secam]
\rput(5.5,8){\white\textbf{Colorspace Pal-Secam}}
\end{pspicture}


\begin{verbatim}
\begin{pspicture}(-1,-1)(8.5,11)
\psChromaticityDiagram[bgcolor=yellow!100!black!20,
               textcolor=black!70,ColorSpace=Pal-Secam]
\rput(5.5,8){\white\textbf{Colorspace Pal-Secam}}
\end{pspicture}
\end{verbatim}

\begin{pspicture}(-1,-1)(10,10)
\psaxes[Dx=0.1,dx=1,Dy=0.1,dy=1]{->}(0,0)(10,10)[$x$,-90][$y$,0]
\pstPlanck[showcontour]
\end{pspicture}

\begin{verbatim}
\begin{pspicture}(-1,-1)(10,10)
\psaxes[Dx=0.1,dx=1,Dy=0.1,dy=1]{->}(0,0)(10,10)[$x$,-90][$y$,0]
\pstPlanck[showcontour]
\end{pspicture}
\end{verbatim}


\clearpage

\makeatletter
\begin{pspicture}(-1,-1)(10,10)
\psaxes[Dx=0.1,dx=1,Dy=0.1,dy=1]{->}(0,0)(10,10)[$x$,-90][$y$,0]
\pstCIEcontour[linecolor=blue]%
\pstCIEcontour[datas=CIE1964,linestyle=dashed]%
\end{pspicture}
\makeatother

\begin{verbatim}
\makeatletter
\begin{pspicture}(-1,-1)(10,10)
\psaxes[Dx=0.1,dx=1,Dy=0.1,dy=1]{->}(0,0)(10,10)[$x$,-90][$y$,0]
\pstCIEcontour[linecolor=blue]%
\pstCIEcontour[datas=CIE1964,linestyle=dashed]%
\end{pspicture}
\makeatother
\end{verbatim}

\begin{pspicture}(-1,-1)(15,15)
\psChromaticityDiagram[unit=1.5,contrast=0.5]%
\pstPlanck[unit=1.5]
\end{pspicture}

\begin{verbatim}
\begin{pspicture}(-1,-1)(15,15)
\psChromaticityDiagram[unit=1.5,contrast=0.5]%
\pstPlanck[unit=1.5]
\end{pspicture}
\end{verbatim}


\begin{pspicture}(-1,-1)(15,15)
\psaxes[Dx=0.2,dx=3,Dy=0.2,dy=3,
  labelFontSize=\scriptscriptstyle]{->}(0,0)(15,15)[$x$,-90][$y$,0]
\pstCIEcontour[unit=1.5,linecolor=blue]%
\end{pspicture}

\begin{verbatim}
\begin{pspicture}(-1,-1)(15,15)
\psaxes[Dx=0.2,dx=3,Dy=0.2,dy=3,
  labelFontSize=\scriptscriptstyle]{->}(0,0)(15,15)[$x$,-90][$y$,0]
\pstCIEcontour[unit=1.5,linecolor=blue]%
\end{pspicture}
\end{verbatim}

\end{center}



\clearpage
\section{List of all optional arguments for \texttt{pst-cie}}
\xkvview{family=pst-cie,columns={key,type,default}}

\bgroup
\RaggedRight
\nocite{*}
\printbibliography
\egroup

\printindex


\end{document}