File: color.html

package info (click to toggle)
cupsddk 1.2.3-5
  • links: PTS, VCS
  • area: main
  • in suites: lenny
  • size: 4,488 kB
  • ctags: 1,125
  • sloc: ansic: 7,074; cpp: 5,423; makefile: 526; xml: 227; sh: 153
file content (349 lines) | stat: -rw-r--r-- 12,771 bytes parent folder | download
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
<html>
<body>

<div align='justify'>

<h1 align='right'><a name='COLOR'>6 - Doing Raster Color Management</a></h1>

<p>This chapter describes how to use the built-in raster color
management functions to produce enhanced color and grayscale
output on raster printers.</p>

<h2>Overview of Raster Color Management</h2>

<p>CUPS provides several ways for CUPS-based raster printer
drivers to manage the colors produced by a non-PostScript
printer. <a href='#FIGURE6-1'>Figure 6-1</a> shows the raster
processing workflow within CUPS. Starting with the print file,
applications can embed ICC and other types of color profiles to
alter the printed output.</p>

<p>Once converted to a RIP file format, the standard RIP filters
can perform various linear transformations during rasterization,
such as gamma correction, density adjustment, and color
transforms using a matrix.</p>

<p>Upon arrival at the printer driver filter, the driver can
perform any number of linear and non-linear transformations as
needed. The DDK drivers and custom driver API offer non-linear
3D lookup tables for transforming grayscale and RGB colors to a
K or CMYK representation and non-linear 2D lookup tables for
transforming K or CMYK colors to device color values.</p>

<!-- NEW PAGE -->
<center><table>
<caption align='bottom'><a name='FIGURE6-1'><i>Figure 6-1, The
CUPS raster processing workflow</i></a></caption>
<tr>
	<td><img src='images/color-management.png' width='302' height='541'
	alt='file-filter-rip-driver-printer'/></td>
</tr>
</table></center>

<P>Once converted to a device color, the color values are then dithered, as necessary, using per-color dithering parameters specific to the target device, rendering mode, resolution, and media.</p>

<p>Color management for PostScript and Ghostscript-based printer
drivers is not currently supported by CUPS. Please consult the
corresponding vendor documentation for any color management
capabilities that are offered for those printers and
drivers.</p>

<h2>RIP-Based Color Profiles</h2>

<p>The first type of color profile supported by CUPS is provided
by the RIP filters and is defined using the
<tt>cupsColorProfile</tt> attribute in the PPD file or the
<tt>profile</tt> attribute in the job options. Each profile
consists of 11 numbers: the density, gamma, and CMY 3x3 color
transform matrix. The <tt>cupsColorProfile</tt> PPD attribute
value contains 11 real numbers separated by spaces, while the
<tt>profile</tt> job attribute contains 11 integers separated by
commas (<tt>,</tt>); multiple the PPD attribute numbers by 1000
to compute the job attribute numbers.</p>

<p>The <tt>cupsColorProfile</tt> attribute is specified using
the <tt>ColorProfile</tt> or <tt>SimpleColorProfile</tt>
directives in a driver information file. Each color profile can
apply to a specific combination of resolution and media type or
to all resolutions or media types. The RIP filter will use the
first matching profile in the PPD file, so it is important to
specify the specific profiles first followed by the general
ones.</p>

<p>The <tt>cupsprofile(1)</tt> utility can be used to generate a
RIP-based color profile using a series of four test pages. The
results are suitable for calibrating basic business-type
graphics to a particular combination of resolution and
media.</p>

<p>One limitation of RIP-based color profiles is that they do
not allow for non-linear color transformations typically
required for accurate color reproduction.</p>

<h2>Driver-Based Color Profiles</h2>

<p>The DDK drivers and driver API provide two types of color
profiles: non-linear 3D RGB or grayscale color lookup
table-based profiles, linear and non-linear 2D device color
lookup table-based profiles, and 2D color dithering tables.
Driver profiles are available only as attributes in the
printer's PPD file.</p>

<h3>RGB Color Profiles</h3>

<p>RGB profiles utilize 3D color lookup tables that map from
sRGB color values to CMYK color values. Two PPD attributes,
<tt>cupsRGBProfile</tt> and <tt>cupsRGBSample</tt>, are used to
specify an RGB color profile. The <tt>cupsRGBProfile</tt>
attribute specifies the number of samples on each side of the
lookup cube, the number of color channels (1, 3, or 4 for K,
CMY, and CMYK devices), and the number of color samples in the
profile:</p>

<pre>
    *cupsRGBProfile Glossy.720dpi: "3 4 27"
</pre>

<p>Currently, the number of color samples must equal the
cube of the cube size, that is an RGB color profile with a cube
size of 4 must have 4 * 4 * 4 = 64 color samples which map the
sRGB colors to CMYK. Also, the RGB samples must be spread
evenly over the color cube.</p>

<p>Each color sample is represented using <tt>cupsRGBSample</tt>
attributes. The value of each attribute consists of the sRGB and
CMYK color values separated by spaces. Each color value is a
real number from 0 to 1. For example, a sample for black which
maps to a CMYK color of 0,0,0,1 might look like the
following:</p>

<pre>
    *cupsRGBSample Glossy.720dpi: "0 0 0 0 0 0 1"
</pre>

<!-- NEED 30 -->
<center><table border='1' cellpadding='5' cellspacing='0'>
<caption align='bottom'><a name='TABLE6-1'><i>Table 6-1,
CMYK color profile attributes</i></a></caption>
<tr bgcolor='#cccccc'>
	<th>Attribute</th>
	<th>Description</th>
</tr>
<tr>
	<td valign='top'><tt>cupsAllGamma</tt></td>
	<td align='justify' valign='top'>Set default curve using gamma + density</td>
</tr>
<tr>
	<td valign='top'><tt>cupsAllXY</tt></td>
	<td align='justify' valign='top'>Set default curve using XY points</td>
</tr>
<tr>
	<td valign='top'><tt>cupsBlackGamma</tt></td>
	<td align='justify' valign='top'>Set black curve using gamma + density</td>
</tr>
<tr>
	<td valign='top'><tt>cupsBlackGeneration</tt></td>
	<td align='justify' valign='top'>Set black generation</td>
</tr>
<tr>
	<td valign='top'><tt>cupsBlackLightDark</tt></td>
	<td align='justify' valign='top'>Set black light/dark transition</td>
</tr>
<tr>
	<td valign='top'><tt>cupsBlackXY</tt></td>
	<td align='justify' valign='top'>Set black curve using XY points</td>
</tr>
<tr>
	<td valign='top'><tt>cupsCyanGamma</tt></td>
	<td align='justify' valign='top'>Set cyan curve using gamma + density</td>
</tr>
<tr>
	<td valign='top'><tt>cupsCyanLightDark</tt></td>
	<td align='justify' valign='top'>Set cyan light/dark transition</td>
</tr>
<tr>
	<td valign='top'><tt>cupsCyanXY</tt></td>
	<td align='justify' valign='top'>Set cyan curve using XY points</td>
</tr>
<tr>
	<td valign='top'><tt>cupsInkChannels</tt></td>
	<td align='justify' valign='top'>Set number of color channels</td>
</tr>
<tr>
	<td valign='top'><tt>cupsInkLimit</tt></td>
	<td align='justify' valign='top'>Set total ink limit</td>
</tr>
<tr>
	<td valign='top'><tt>cupsLightBlackGamma</tt></td>
	<td align='justify' valign='top'>Set light black curve using gamma + density</td>
</tr>
<tr>
	<td valign='top'><tt>cupsLightBlackXY</tt></td>
	<td align='justify' valign='top'>Set light black curve using XY points</td>
</tr>
<tr>
	<td valign='top'><tt>cupsLightCyanGamma</tt></td>
	<td align='justify' valign='top'>Set light cyan curve using gamma + density</td>
</tr>
<tr>
	<td valign='top'><tt>cupsLightCyanXY</tt></td>
	<td align='justify' valign='top'>Set light cyan curve using XY points</td>
</tr>
<tr>
	<td valign='top'><tt>cupsLightMagentaGamma</tt></td>
	<td align='justify' valign='top'>Set light magenta curve using gamma + density</td>
</tr>
<tr>
	<td valign='top'><tt>cupsLightMagentaXY</tt></td>
	<td align='justify' valign='top'>Set light magenta curve using XY points</td>
</tr>
<tr>
	<td valign='top'><tt>cupsMagentaGamma</tt></td>
	<td align='justify' valign='top'>Set magenta curve using gamma + density</td>
</tr>
<tr>
	<td valign='top'><tt>cupsMagentaLightDark</tt></td>
	<td align='justify' valign='top'>Set magenta light/dark transition</td>
</tr>
<tr>
	<td valign='top'><tt>cupsMagentaXY</tt></td>
	<td align='justify' valign='top'>Set magenta curve using XY points</td>
</tr>
<tr>
	<td valign='top'><tt>cupsYellowGamma</tt></td>
	<td align='justify' valign='top'>Set yellow curve using gamma + density</td>
</tr>
<tr>
	<td valign='top'><tt>cupsYellowXY</tt></td>
	<td align='justify' valign='top'>Set yellow curve using XY points</td>
</tr>
</table></center>

<p>Similarly, blue mapping to a CMYK value of 1,0.5,0,0 would
look like:</p>

<pre>
    *cupsRGBSample Glossy.720dpi: "0 0 1 1 0.5 0 0"
</pre>

<h3>CMYK Color Profiles</h3>

<p>CMYK color profiles map K, CMY, or CMYK colors to device
colors. They are normally used to provide linear CMYK output and
to transition between light and dark inks. When combined with
application or RGB profiles, CMYK profiles allow for easier
profiling using existing 4-color profiling software.</p>

<p>The CMYK color profiles are implemented as 2D lookup tables;
the tables can be generated automatically using gamma and
density values, or manually using measurements of specific
values. For printers that support more than 4 inks, the light
ink lookup tables are driven by the main color, e.g. the light cyan
output value is based upon the cyan input value.</p>

<p>CMYK color profiles are only available via PPD attributes. <a
href='#TABLE6-1'>Table 6-1</A> lists the supported attributes.
The <tt>cupsInkChannels</tt> attribute specifies the number of
output color channels, typically 1, 3, 4, 6, or 7.</p>

<p>The <tt>cupsInkLimit</tt> attribute specifies the maximum
amount of ink that can be placed on the page. When the total
amount of ink exceeds the ink limit, all color channels are
scaled linearly to the specified limit.</p>

<p>The <tt>cupsBlackGeneration</tt> attribute specifies a
transition range for representing shades of gray as a
combination of CMY or as K. The first number specifies the start
of the transition range where K = 0 and the second the end of
the transition range where CMY = 0.</p>

<p>The gamma attributes define the gamma and density of the
specified color channel. For example, the following attribute
sets the default gamma and density at 1440dpi to 2.0 and 0.9,
respectively:</p>

<pre>
    Attribute cupsAllGamma 1440dpi "2.0 0.9"
</pre>

<p>The XY attributes specify a point in a piecewise linear curve
from an input color value to a measured output value. For
example, the XY values for four measurements at 1440dpi would
look like the following:</p>

<pre>
    Attriute cupsAllXY 1440dpi "0.25 0.337"
    Attriute cupsAllXY 1440dpi "0.5 0.633"
    Attriute cupsAllXY 1440dpi "0.75 0.91"
    Attriute cupsAllXY 1440dpi "1.0 1.24"
</pre>

<p>The <tt>LtDk</tt> ("light dark") attributes specify a
transition area for light to dark inks using the dark ink lookup
table. The first value specifies the input color value which
maps to 100% of the light color output value and the second
value specifies the input color value which maps to 0% of the
light color output value. The dark color is mapped to 0 up to
the first value and is ramped up to the second value as the
light color decreases.</p>

<!-- NEED 15 -->
<center><table border='1' cellpadding='5' cellspacing='0'>
<caption align='bottom'><a name='TABLE6-2'><i>Table 6-2,
Dither attributes</i></a></caption>
<tr bgcolor='#cccccc'>
	<th>Attribute</th>
	<th>Description</th>
</tr>
<tr>
	<td valign='top'><tt>cupsAllDither</tt></td>
	<td align='justify' valign='top'>Sets the default dither values</td>
</tr>
<tr>
	<td valign='top'><tt>cupsBlackDither</tt></td>
	<td align='justify' valign='top'>Sets the black dither values</td>
</tr>
<tr>
	<td valign='top'><tt>cupsCyanDither</tt></td>
	<td align='justify' valign='top'>Sets the cyan dither values</td>
</tr>
<tr>
	<td valign='top'><tt>cupsLightBlackDither</tt></td>
	<td align='justify' valign='top'>Sets the light black dither values</td>
</tr>
<tr>
	<td valign='top'><tt>cupsLightCyanDither</tt></td>
	<td align='justify' valign='top'>Sets the light cyan dither values</td>
</tr>
<tr>
	<td valign='top'><tt>cupsLightMagentaDither</tt></td>
	<td align='justify' valign='top'>Sets the light magenta dither values</td>
</tr>
<tr>
	<td valign='top'><tt>cupsMagentaDither</tt></td>
	<td align='justify' valign='top'>Sets the maenta dither values</td>
</tr>
<tr>
	<td valign='top'><tt>cupsYellowDither</tt></td>
	<td align='justify' valign='top'>Sets the yellow dither values</td>
</tr>
</table></center>

<h3>Dithering Tables</h3>

<p>Once converted to device colors, the dither functions use PPD
attributes to define the dot densities for each supported size.
<a href='#TABLE6-2'>Table 6-2</a> lists the supported
attributes. For example, the following attributes might be used
to define the default dither values for three resolutions:</p>

<pre>
    Attribute cupsAllDither 360dpi "0.5 0.75 1.0"
    Attribute cupsAllDither 720dpi "0.6 0.9 1.2"
    Attribute cupsAllDither 1440dpi "0.9 1.35"
</pre>

</div>

</body>
</html>