PCL 5 Color Technical Reference Manual
Notice The information contained in this document is subject to change without notice. Copyright and License Copyright © 1999 Hewlett-Packard Company. All rights are reserved. This document contains proprietary information which is protected by copyright. Except as allowed by copyright laws or herein, reproduction, adaptation, or translation without prior written permission is prohibited. Hewlett-Packard Company 11311 Chinden Boulevard Boise, Idaho 83714 U.S.A.
Inside This Manual What You Can Learn From This Manual This manual describes the PCL 5 commands used to print color on the HP Color LaserJet printer family and the other Hewlett-Packard PCL 5 color printers. Some of the main topics include an overview of the color printing process, using palettes, choosing color modes, adjusting output color to meet your requirements, printing color raster graphics, and HP-GL/2 vector graphics. Examples are provided which demonstrate the use of the PCL 5 color commands.
Manual Organization This manual contains seven chapters and four appendices. Chapters 2 through 4 describe command usage for the HP Color LaserJet 4500 and 8500 printers. Appendices A through D describe how these functions are achieved on the HP Color LaserJet, Color LaserJet 5, 5M, and the DeskJet 1200C and 1600C printers. Chapters 5 through 7 pertain to all the color printers described in this manual. A brief description of each chapter is provided below. Chapter 1.
Chapter 7. Color Vector Graphics (HP-GL/2) This chapter discusses printing color pages using HP-GL/2, the vector graphics language included on all PCL 5 printers. The chapter describes new and/or modified HP-GL/2 commands and how they are used to print with HP color printers. Appendix A. Color Printing Overview (Color LaserJet, 5, 5M, DeskJet) Appendix A explains background information about printing color documents using PCL 5. Topics include palettes, device-dependent vs.
Related Documents The following documents provide related information about Hewlett-Packard PCL 5 printers. PCL 5 Printer Language Technical Reference Manual The PCL 5 Printer Language Technical Reference Manual provides a description of the printer command language that controls PCL 5 printers. The manual provides explanations of each PCL command, and has examples demonstrating how the commands are used to manipulate the printer.
Contents PCL 5 Color Technical Reference Manual Inside This Manual . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . iii Manual Organization . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . iv Related Documents. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . vi Chapter 1 Color Printing Overview Introduction . . . . . . . . . . . . . . . . . . . . . . . . . .
CID Color Palettes. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .3-13 Device RGB and sRGB Palettes. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .3-13 Device CMY Palettes . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .3-14 HP-GL/2 Palettes . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .3-15 Foreground Color . . . . . . . . . . . . . . . . . .
Rectangular Fill Examples. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .5-52 Solid Fill (Black/White) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .5-52 Shaded Fill . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .5-54 Chapter 6 Raster Graphics Introduction . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
Appendix A Color Printing Overview (Color LaserJet, 5, 5M, DeskJet) Introduction . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . A-1 Color Concepts . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . A-3 Palettes . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . A-3 Raster Mode . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
Programming Color Palettes . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . Color Component One . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . Color Component Two . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . Color Component Three . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . Assign Color Index . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
Contents xii EN
1 Color Printing Overview Introduction This chapter provides an overview of color printing with Hewlett-Packard printers. A primary goal for HP color printers has always been WYSIWYG (What You See Is What You Get) color, where the color displayed on the screen while creating a document is the same as the color in the printed document.
Working with color documents A document can be thought of as a series of text characters, vector graphics objects and images. The parts of a document either have color specifications in them, as do color images, or have color specifications applied to them, as do color vectors or text. For color images, the PCL 5 command set provides a way to specify the color format so that the image data can be interpreted correctly.
The PCL language also allows users to use patterns in combination with colors. These patterns and colors can be combined with text, vector graphics, and images to create new, complex graphics objects. The PCL Print Model determines the logical operations (known as ROPs, Raster Operations) used to combine each part of the graphic object. PCL 5 Color Concepts This section describes some of the concepts and terminology of color science related to the PCL 5 color commands.
Color can be described in ways other than amounts of red, green, and blue light. Generally, these color specification systems are known as color spaces. For example, The Cyan, Magenta, Yellow (CMY) color space is used to describe colors that are printed by depositing varying amounts of these three ink pigments (Cyan, Magenta, Yellow). The absence of pigment is considered to be white, and the presence of all three is black.
Note HP’s ICC profiles are available through normal HP software distribution channels. For those who want the additional control available through building their own ICC profiles, there are several vendors of profiling tools available. To provide access to the printer's pure primaries and entire available printer gamut, the Vivid mode may be used when profiling the printer, and subsequently when using the ICC workflow.
Palettes and Color Selection The PCL 5 language allows the user to define a palette of colors. Each color is specified by three quantities or values which are interpreted depending on the color space. For example, the color white in an RGB palette is (1, 1, 1) while this set of values in a CMY palette defines the color black. Each color in the palette is accessed using an index number, starting with 0 as the first color in the palette.
z An RGB, eight-entry palette with the following colors starting at index 0: black, red, green, yellow, blue, magenta, cyan, and white. z A CMY, eight-entry palette with the following colors starting at index 0: white, cyan, magenta, blue, yellow, green, red and black. • PCL Imaging mode is entered with the Configure Image Data command that creates a programmable palette of a programmed size. This palette can be programmed using the color component and set index commands.
The PCL 5 color command set supports several Pixel Encoding Modes. The PEMs are categorized first by whether the pixel is an index into a palette, or a color specification. The other PEM categorization is whether the pixel data is divided into planes and transferred one plane at a time or is transferred in sequential order. There are four supported Pixel Encoding modes: 1 Indexed by Plane 2 Indexed by Pixel 3 Direct by Plane 4 Direct by Pixel (also known as 24-bit direct).
Well-Behaved Raster PCL raster images are processed most efficiently when the height and width of the image are specified before the Raster Start command begins an image data transfer. Furthermore, the entire image should be transferred before using the End Raster command to end the image. If the image is broken into pieces, certain print artifacts such as lines or squares can appear in the image.
1-10 Color Printing Overview EN
2 Using Color Modes Introduction The PCL printer language has four color modes: • Black-and-White • Simple Color • PCL Imaging • HP-GL/2 Imaging PCL allows you to use any mode or combination of modes to accomplish your printing objectives most efficiently. All four of the color modes create a palette. The palette for each mode is discussed in the section describing that mode, and also in Chapter 3 (“Using Palettes”). Black-and-White Mode (Default) Black-and-White Mode is the default color mode.
PCL Imaging Mode PCL Imaging Mode, enabled by the Configure Image Data command (?*v#W), allows a maximum of 24 bits per pixel for color specification. Therefore, more colors may be specified than are obtainable in Simple Color Mode. In the PCL Imaging Mode, pixel encoding mode, bits per pixel, bits per primary, and the color palette are all programmable.
Simple Color Mode The Simple Color command (?*r#U) specifies color selection from a fixed palette. RGB or CMY raster data must be sent by plane (?*b#V) as well as by row (?*b#W). The last plane in each row is sent using the ?*b#W command; all other planes are sent using the ?*b#V command. In Simple Color mode, the pixel encoding mode is always indexed planar. Simple Color Command The Simple Color command creates a fixed-size palette, whose color specification cannot be modified.
The Simple Color palettes are structured as follows: Single Plane (value = 1) Index Color 0 White 1 Black 3-Plane RGB (value = 3) Index Color 0 Black 1 Red 2 Green 3 Yellow 4 Blue 5 Magenta 6 Cyan 7 White 3-Plane CMY (value = –3) 2-4 Using Color Modes Index Color 0 White 1 Cyan 2 Magenta 3 Blue 4 Yellow 5 Green 6 Red 7 Black EN
PCL Imaging Mode The PCL Imaging mode, entered using the Configure Image Data (CID) command (?*v#W), creates a variable-sized programmable palette. It provides multiple color spaces, pixel encoding modes, and reprogrammable palettes. Configure Image Data (CID) Command The CID command provides configuration information for creating palettes and transmitting raster data.
The bytes are ordered as follows and are unsigned bytes: Byte 15 (MSB) 8 7 0 (LSB) Byte 0 Color space Pixel encoding mode 1 2 Bits/index Bits/primary #1 3 4 Bits/primary #2 Bits/primary #3 5 Invalid configurations of the CID command are ignored and the data discarded. A minus or a plus sign in the value field (-6 or 6) is ignored The data fields in the command, bytes zero to five, must contain byte-aligned binary data, not ASCII data.
Byte 1 (Pixel Encoding Mode) This byte designates the format of any subsequent raster images. The range of the value is zero to three. All other values for this field are ignored. Value Pixel Encoding Mode Restrictions 0 Indexed by Plane Bits/Index can only be 1, 2, 3, 4, 5, 6, 7, or 8. Bit/Components 1, 2, and 3 are ignored 1 Indexed by Pixel Bits/Index can only be 1, 2, 4, or 8.
PEM 0: INDEXED BY PLANE In Pixel Encoding Mode 0, successive planes of data are sent for each raster row. A plane contains one bit for each pixel in a row. A pixel is not fully defined until all the planes for that row have been received, which is signaled by a transfer raster row command. The planes in a row form index numbers into the current palette.
PEM 1: INDEXED BY PIXEL In this mode, each pixel in a row is fully specified before any bits are sent for the next pixel. The bits for each pixel form a palette index number. Assuming four bits per index, the underlined block below is the palette index for pixel two of row one (i1 is the least significant bit). ?*b#W row 1 i4 i3 i2 i1 i4 i3 i2 i1 . . . ?*b#W row 2 i4 i3 i2 i1 i4 i3 i2 i1 . . . ?*b#W row 3 i4 i3 i2 i1 i4 i3 i2 i1 . . .
MODE 2: DIRECT BY PLANE In this mode, a pixel is composed of three, one-bit components. The data is transferred a plane at a time, one plane for each component. Therefore, each bit in a plane represents one component of a pixel. The underlined bits below show the components for a pixel.
MODE 3: DIRECT BY PIXEL This mode specifies a pixel as three, eight-bit components, thus the name 24-bit direct color. Assuming the RGB color space with the mandatory eight bits per component, the underlined bytes below define the first pixel of row two. ?*b#W ?*b#W ?*b#W row 1 r7–r0 g7–g0 b7–b0 . . . row 2 r7–r0 g7–g0 b7–b0 . . . row 3 r7–r0 g7–g0 b7–b0 . . .
• In the Indexed-by-Pixel PEM, where the raster data is interpreted as palette indices, this value determines how to interpret the byte-ordered row transfers. The following list shows how each byte is translated into indices: Bits/Index Indices/Byte 1 8 2 4 4 2 8 1 • In the Direct-by-Plane and Direct-by-Pixel PEMs, byte 2 does not apply to the raster format. Bytes 3, 4, and 5 (No. of Bits for Components 1, 2, and 3) These bytes are ignored for the Indexed by Plane and Indexed Direct PEMs.
HP-GL/2 Imaging Mode The HP-GL/2 Imaging Mode provides a way of using vector commands in printing documents. Although the default PCL and HP-GL/2 palettes are not the same, when transferring from PCL to HP-GL/2, active palette information does stay the same. You can switch between PCL and HP-GL/2 and use the same palette, and you can also modify palettes using either PCL or HP-GL/2.
2-14 Using Color Modes EN
3 Using Palettes Introduction A palette is a collection of color specifications selected using index numbers. The figure below illustrates a palette. Each palette entry associates an index number with three primary color components. For HP-GL/2 purposes only, a pen width is also associated with each palette entry.
In non-raster mode, the current palette contains all the available colors. In raster mode, indexed color selection uses the palette, but direct selection does not. Default palettes are created by all the PCL color modes (Black and White, Simple Color, PCL Imaging, and HP-GL/2 Imaging). The active palette may be modified when in the PCL Imaging or HP-GL/2 imaging modes, but not when in the Simple Color or Black and White modes.
Saving the Palette The current palette is destroyed when a new palette is created. The Push/Pop Palette command (?*p#P) can save (push) the current palette and then restore (pop) it. Push/Pop Palette Command This command pushes or pops the palette from the palette stack. ?*p#P #= 0 - Push (save) palette 1 - Pop (restore) palette Default = 0 Range = 0, 1 (invalid values are ignored) A value of 0 (?*p0P) pushes a copy of the active palette onto the palette stack.
Pushing a palette does not save the following parameters. • Foreground color • Color components: 1st, 2nd, and 3rd • Finish mode • Monochrome print mode The palette stack depth is limited by printer memory. Attempts to push a palette with insufficient memory cause an out-of-memory error. Attempts to pop from an empty stack are ignored. Macros can push and pop palettes.
Palette Management by ID All palettes have a unique ID (identification number). The default black and white palette created on power-up or ?E has an ID of 0. Palette management by ID lets applications have multiple palettes. As shown below, multiple palettes can exist in two areas: the palette stack and the palette store. The stack holds palettes that are pushed via a Push/Pop Palette command; the store holds palettes having palette IDs.
Management by ID allows applications to tag data, have multiple raster configurations, and have palettes for different color spaces—all without reconfiguring the active palette. For example, one palette can be created for PCL text, one for HP-GL/2 primitives, one for simple raster, and one for 24-bit raster. The application can then switch between palettes according to what is being sent to the printer. Selecting a new active palette changes the PCL graphics state.
When a palette creation command is received such as Configure Image Data (?*v#W), Simple Color (?*r#U), or an HP-GL/2 IN, the created palette overwrites the active palette and is assigned the current palette select ID. A palette popped from the stack overwrites the active palette, and is assigned the current palette select ID.
Palette Control ID The Palette Control ID command specifies the ID number to be used by the Palette Control Command. ?&p#I # = Palette ID number Default = 0 Range = 0 to 32767 (command is ignored for out-of-range values) The ID number specified by this command is saved as the palette control ID and is used by the Palette Control command (?&p#C). ?E or power-up resets the palette control ID to 0, which is then the default black and white palette ID.
Palette Control The Palette Control command provides a mechanism for making and deleting palettes.
The Palette Control command provides a way of managing system memory by deleting palettes in either the stack or store that are no longer in use. Palette Control that is exercised during macros can have significant impact on palettes that exist within the system. Deleting all palettes, or those on the stack, or the current palette, or all those except on the stack can have adverse effects when the macro is exited.
Simple Color Palettes The Simple Color command (?*r#U) provides a quick way to select colors from a fixed, non-programmable palette. The Simple Color command overwrites the current palette with one of the fixed palettes below. When the Simple Color command is in effect, the PCL and HP-GL/2 commands that modify a palette entry (NP, PC, ?*v#A, ?*v#B, ?*v#C, ?*v*I, ?*t*I) are locked out. A popped simple color palette cannot be modified and the pixel encoding mode reverts to “index by plane”.
3-Plane CMY (value = –3) 3-12 Using Palettes Index Color 0 White 1 Cyan 2 Magenta 3 Blue 4 Yellow 5 Green 6 Red 7 Black EN
CID Color Palettes The Configure Image Data command, explained in detail in Chapter 2, creates a palette based upon the parameters in its data field. CID-created palettes are programmable: any entry can be reassigned a different color using PCL commands (?*v#A, ?*v#B, ?*v#C, ?*v*I) or HP-GL/2 commands (PC, NP). Default palettes vary by color space.
Device CMY Palettes Bits/Index = 1 Index Color 0 White 1 Black Index Color 0 White 1 Cyan 2 Magenta 3 Black Bits/Index = 2 Bits/Index = 3 through 8 3-14 Using Palettes Index Color 0 White 1 Cyan 2 Magenta 3 Blue 4 Yellow 5 Green 6 Red 7 Black n>7 Black EN
HP-GL/2 Palettes Regardless of the color space, a default PCL palette is always different than a default HP-GL/2 palette. The following table shows the default palettes established in HP-GL/2.
Eight Pens 3-16 Using Palettes Pen Number Color 0 White 1 Black 2 Red 3 Green 4 Yellow 5 Blue 6 Magenta 7 Cyan n>7 Black EN
Foreground Color All PCL marking entities utilize “foreground” color, which is selected from the current palette using the Foreground Color command (?*v#S). Foreground color interacts with raster color depending on the print model commands in effect. Foreground Color Command The Foreground Color command sets the foreground color to the specified index of the current palette.
Note Foreground color interacts with color raster images. In the printer, all color raster is resolved into three binary raster planes of CMY. Foreground color is applied to these planes, modifying the color image. For no interaction, set foreground color to black when sending color raster images.
Programming Color Palettes Except for the default black and white palette or the Simple Color palettes (?*r#U), palette entries can be modified. The three primary components of a color are specified and the resulting color is assigned to the palette entry indicated by ?*v#I. In the explanation below, the term “component” refers to the color space primary colors. For example, if the current color space is sRGB, component 1 indicates R, component 2 indicates G, and component 3 indicates B.
Color Component Three This command specifies the third component of the palette entry designated by the Assign Color Index command. ?*v#C # = Third Component Default = 0 Range = –32767.0000 to 32767.0000 (up to 4 decimal places; command is ignored for invalid configurations) The Assign Color Index command actually applies this value and then resets it to 0. Assign Color Index This command assigns the three current color components to the specified palette index number.
4 Modifying Output Color Introduction The previous chapters of this manual have been concerned with giving an overview of the color printing process, choosing color modes, and using palettes. This portion of the manual explains how color can be modified to produce a desired result, from using halftone render algorithms to change the way color is rendered, to selecting a color treatment and finish mode.
Halftone Render Algorithms The HP color printers have the capability of applying different halftone render algorithms to achieve the desired output on the printed image. Render algorithms allow you to change the characteristics of the image by changing the way pixels are rendered. Each halftone render algorithm produces a different affect on the output, varying the texture and color appearance of the printed image.
Monochrome Printing The Monochrome Print Mode command converts each color value to its grayscale equivalent. This improves throughput, costs less to print, and eliminates waste by providing a draft mode. Monochrome Print Mode Command The Monochrome Print Mode command designates whether to print using the current rendering mode or a fast gray-scale equivalent. Pages printed using the gray-scale equivalent do not use any color and therefore print faster and more economically.
Driver Configuration Command This command specifies the color treatment applied to each color specification.
Screen Match Due to the emergence of sRGB (standard Red Green Blue) as an international color data standard, there is no longer a need to provide color adjustments in the printer driver to account for alternate types of RGB data. sRGB is the native color space of monitors, the default color space of the World Wide Web, the default space of many digital cameras and scanners. This treatment indicates that the printer should be ready to accept sRGB data.
Finish Mode Command The Finish Mode command allows the user to specify the finish, matte or glossy, to be applied to the document. A normal page has a matte finish. Glossy finish can be requested to be applied to the page as it’s printed. The finish is distinct from the type of media. Therefore, a matte finish can be requested for glossy media, and a glossy finish can be requested for plain or matte paper.
5 The PCL Print Model Introduction The Print Model feature allows images and characters to be filled with color, with any of the printer's predefined shading or cross-hatch patterns, or with a user-defined pattern. Images include any raster graphic, such as one created with PCL raster graphics commands (as described in Chapter 6, Raster Graphics); a rectangular fill area (as described later in this chapter as PCL Rectangular Area Fill Graphics); or characters selected from any font.
• Pattern—The design which is “painted” through the non-white area of the source image onto the destination image. The pattern is defined by the Current Pattern (?*v#T) command. It may be a color pattern or a single-plane monochrome mask, such as the printer's internal predefined shading or cross-hatch patterns, or a user-defined pattern. Foreground color is not applied to a user-defined color pattern. When printing a page, text and raster images are printed using the current pattern.
• Pattern Transparency Mode—The transparency or opaqueness of the “white pixels” in the pattern (see the note below). When set to 0 (transparent), these pixels have no effect on the destination; when set to 1 (opaque), they are applied through the black pixels of the source pattern to the destination. • Logical Operations—the Print Model uses logical operations, such as AND, OR, XOR, and NOT when determining which bits of the source, pattern, and texture become part of the resulting image.
Figure 5-3 demonstrates the transparency modes. In the first example (1a), the transparency mode for both the source image and the pattern is transparent. Since the source mode is “transparent,” only the non-white region (the circle) of the source image is overlaid on the destination. Since the pattern mode is also transparent, the patterned source image is applied only to the white areas of the destination.
Figure 5-3 EN Effect of Transparency Modes on Images The PCL Print Model 5-5
Command Sequence The table below shows the Print Model command sequence for selecting a current pattern and using it to fill a destination image. The commands for specifying transparency modes, logical operations, and patterns are discussed beginning on the following page. Foreground color is described in Chapter 3. Operation Download Page Data Comments Prior raster and character data downloaded to the page is considered destination image.
Source Transparency Mode Command The Select Source Transparency Mode command sets the source image's transparency mode to transparent or opaque. This command determines whether the source's white pixels are applied to the destination. ?*v#N #= 0 - Transparent 1 - Opaque Default = 0 Range = 0, 1 (other values cause the command to be ignored) With a transparency mode of “0” (transparent), the white regions of the source image are not copied onto the destination.
Pattern Transparency Mode Command The Pattern Transparency Mode command sets the pattern's transparency mode to transparent or opaque. ?*v#O #= 0 - Transparent 1 - Opaque Default = 0 Range = 0, 1 (other values cause the command to be ignored) A transparency mode of “0” (transparent) means that the white regions of the pattern image are not copied onto the destination. A transparency mode of “1” (opaque) means that the white pixels in the pattern are applied directly onto the destination.
Logical Operations The basic print model defines how a pattern, source image, and destination image are applied to each other using the print model’s transparent and opaque modes to produce a resulting image. The Logical Operations (?*l#O) command specifies which logical operation is to be performed on the source, texture, and destination to produce a new destination. Transparency modes should be specified before the logical operation is performed or printable data is sent.
Operators • Source Transparency (specified before logical operation; default is transparent) • Pattern Transparency (specified before logical operation; default is transparent) • Logical Operators (default is Texture OR Source) Operands • Source objects: character cell, raster image, rule, HP-GL/2 vectors and polygons • Texture: foreground color + pattern mask, color pattern (format 1).
Assuming three bits per pixel, the following diagram shows the process. Figure 5-4 Logical Operations and the Print Model Note The Logical Operation command (?*l#O) provides 255 possible logical operations. All of these logic operations map directly to their ROP3 (raster operation) counterparts (see the Microsoft Document, Reference, Volume 2, Chapter 11, Binary and Ternary Raster Operation Codes). The logical operations were defined for Microsoft Windows for an RGB color space.
Logical Operations and Transparency Interactions As described above, transparency modes operate in addition to logical operations. The Logical Operations (ROP3) in Table 5-4 are true only if source and pattern transparency (for white pixels) are explicitly set to opaque (?*v1N and ?*v1O). If source and/or pattern transparency modes are transparent (defaulted), the additional operations shown below must be performed to achieve the final result.
Logical Operation Command Specifies the logical operation (ROP) to be performed in RGB color space on destination, source and texture to produce new destination data. Texture is defined as a combination of pattern and foreground color.
For example, the logic equation for ROP 252 in the RGB color space is T OR S, which is shown as TSo in Table 5-4. The truth table for the ROP is shown above, and can be seen to correspond to the logic equation TSo, that is, D gets the value of T OR S without regard to the current value of D. Furthermore, the binary value of 252 is 11111100 and corresponds with the value of the D for all the combinations of T and S, when the truth table starts with (1, 1, 1) and ends with (0, 0, 0).
Table 5-1.
Table 5-2.
Note Since PCL logical operations are interpreted in RGB space (white = 1, black = 0) rather than in CMY space (white = 0, black = 1), the results may not be intuitive. For example, ORing a white object with a black object in RGB space yields a white object. This is the same as ANDing the two objects in CMY space. It must be remembered that the printer operates in CMY space and inverts the bits.
The result is computed below (source and pattern opaque). Table 5-3. Logical Operation (ROP3) Bits 7 6 5 4 3 2 1 0 Texture 1 1 1 1 0 0 0 0 Source 1 1 0 0 1 1 0 0 Destination 1 0 1 0 1 0 1 0 ROP3 (source & pattern) 1 1 1 1 1 1 0 0 (decimal 252) Each column of destination, source, and texture values are the input to the logical function.
Table 5-4.
Table 5-4.
Table 5-4.
Table 5-4.
Table 5-4.
Pixel Placement HP PCL 5 printers place pixels at the intersection of the squares of a theoretical, device-dependent grid covering the printable area on the page. Depending on the image and the logical operation in effect, a problem may occur when the sides of two polygons touch each other—the pixels along the common border may be printed twice or not at all.
Figure 5-5 Pixel Placement Note The grid-centered method is used by Microsoft Windows. When rectangular area fills are used and grid intersection is used, an overlapping of pixels can occur if rectangular area fills are placed adjacent to one another (as shown below). Depending on the raster operation presently in effect, this overlap can produce undesirable results in the final printed image. To avoid this problem, use the grid-centered method.
Note Since PCL printers print only at intersections, grid- centered pixel placement is implemented as shown on the right. Figure 5-6 Pixel Placement Variations There are two commands that modify the pixel placement function: the PCL Pixel Placement command (?*l#R) and the HP-GL/2 Pixel Placement command (PP).
Pixel Placement Command Determines how pixels are rendered in images. ?*l # R #= 0 - Grid intersection 1 - Grid centered Default = 0 Range = 0, 1 (command is ignored for other values) Two models are used for rendering pixels when an image is placed on paper: • Grid Intersection Model • Grid Centered Model This command can be used multiple times per page. It has no effect except to switch the model being used for imaging.
Filling with Patterns The procedure for applying patterns to text, raster images, and rectangular areas is essentially the same, except that for text and raster images the Current Pattern (?*v#T) command is used, and for rectangular areas the Fill Rectangular Area (?*c#P) command is used. The procedures below describe how to fill with PCL and HP-GL/2 patterns. Patterns for Text and Raster Images Use the following general procedure to fill text and raster images with a non-solid pattern.
Pattern ID (Area Fill ID) Command The Pattern ID command (formerly called Area Fill ID) identifies the specific shading, cross-hatch, or user-defined pattern. (This command is also used for rectangular area fill, described later in this chapter.
Figure 5-7 Shading Patterns 5-30 The PCL Print Model EN
Figure 5-8 EN Cross-Hatch Patterns The PCL Print Model 5-31
Select Current Pattern Command The Select Current Pattern command identifies the type of pattern to be applied onto the destination. ?*v#T #=0 1 2 3 4 - Solid black or foreground color Solid white Shading pattern Cross-hatch pattern User-defined pattern Default = 0 Range = 0 - 4 (values outside of range are ignored) This command selects which type of pattern is applied.
User-Defined Pattern Graphics In addition to the eight shading patterns and six cross-hatch patterns, users can design their own fill patterns. These user-defined patterns are downloaded to the printer and controlled using three commands: • Download Pattern ?*c#W [data] • Set Pattern Reference Point ?*p#R • Pattern Control ?*p#Q Using User-Defined Patterns To create a new pattern, a user defines a binary raster data image as a base pattern.
Note For efficient memory usage and improved performance, it is strongly recommended that user-defined patterns should be 8x8, 16x16, or 32x32 in size. Specification of patterns that are either 1 pixel in height or width is strongly discouraged. If user-defined halftones are also used, they need to be either the same size or multiples of each other to avoid render anomalies due to each pattern being rendered differently across the page (if tiled), or due to variations in xy position.
Figure 5-10 EN Pattern Layout Across the Printable Area The PCL Print Model 5-35
Pattern Reference Point The pattern reference point is a position on the logical page at which the base pattern is positioned for tiling. The upper left corner of the base pattern is positioned at this point (see Figure 5-10). The default pattern reference point is position 0,0. However, it is possible to set the pattern reference point to the current cursor position. This allows the pattern to be positioned or adjusted for fill areas.
Figure 5-11 EN Moving Pattern Reference Point for Pattern Filling The PCL Print Model 5-37
Download Pattern Command The Download Pattern command provides the means for downloading the binary pattern data that defines the user pattern. ? * c # W [pattern data] # = Number of pattern data bytes Default = 0 Range = 0 – 32767 (HP Color LaserJet 8500 extends the range to 0 to 65535; values outside the range are ignored) The value field (#) identifies the number of pattern data bytes that follow the Download Pattern command.
Continuation (Byte 1) This field, byte 1, must be set to “0.” (This byte is for future printer support and does not currently provide any continuation operation.) Pixel Encoding (Byte 2) The bits/index field may be either 1 or 8. If the value is 1, the color of each pattern dot is specified by a single bit, supporting a two-color palette, which need not be black and white. If the value is 8, the color of each pattern dot is specified by one byte of data, allowing 256 colors.
User-defined Pattern Example This example shows how the user-defined pattern command is used to create new patterns. For this example, a pattern of triangles is used. The first step is to design the base pattern triangle (in this case, using 64 bytes of data).
When using the 300 dpi User-Defined Pattern header (see Table 5-5), set the eight bytes of header information to the following values: Byte 0 – Format 0 (00 hex) Byte 1 – Continuation 0 (00 hex) Byte 2 – Pixel Encoding 1 (01 hex) Byte 3 – Reserved 0 (00 hex) Byte 4/5 – Height in Pixels 0 / 16 (00 / 10 hex) Byte 6/7 – Width in Pixels 0 / 32 (00 / 20 hex) Byte 8 – Begins the first bytes of binary data. The PCL code below downloads the user-defined pattern and assigns it an ID number of 3. 1.
Send the pattern header and binary data: 00 FF 7F 3F 1F 0F 07 03 01 00 00 00 00 00 00 00 00 Note 00 FF FF FF FF FF FF FF FF FF 7F 3F 1F 0F 07 03 01 01 FF FF FF FF FF FF FF FF FF FE FC F8 F0 E0 C0 80 00 00 10 00 20 FF FE FC F8 F0 E0 C0 80 00 00 00 00 00 00 00 00 There must be an even number of bytes in user-defined pattern data, hence the trailing zeros (“padding”) in the last eight data rows above.
Set Pattern Reference Point Command The Set Pattern Reference Point command causes the printer to tile patterns with respect to the current cursor position (CAP). This command also specifies whether the pattern rotates with the print direction or remains fixed. ?*p#R #= 0 - Rotate patterns with print direction 1 - Keep patterns fixed Default = 0 Range = 0,1 (values outside the range are ignored) A value field of 0 rotates the patterns with changes in the print direction (see Print Direction command).
Pattern Control Command The Pattern Control command provides a means for manipulating user-defined patterns.
Rectangular Area Fills (Rules) Rectangular area fills are a special case of source images—the source transparency mode has no effect, since the printer treats the rectangular area as a solid “black” (all 1’s) source. Rectangular areas may be filled using patterns or textures. The current Pattern ID (?*c#G) selects the pattern, and the Fill Rectangular Area command (?*c#P) tiles an area whose dimensions are specified by the Vertical and Horizontal Rectangle size commands (?*c#A, ?*c#B, ?*c#H, ?*c#V).
Horizontal Rectangle Size (PCL Units) This command specifies the horizontal rectangle size in PCL Units. ?*c#A # = number of PCL Units (valid to 4 decimal places) The horizontal rectangle size is clipped to the bounds of the logical page. Values greater than the logical page boundary are acceptable; however, the final output is limited to the printable area of the logical page. Values outside the range of 0 – 32767 are ignored. The default rectangle size is 0.
Vertical Rectangle Size (PCL Units) This command specifies the vertical rectangle size in PCL Units. ?*c#B # = number of PCL Units (valid to 4 decimal places) The vertical rectangle size is clipped to the bounds of the logical page. Values greater than the logical page boundary are acceptable; however, the final output is limited to the printable area of the logical page. Values outside the range of 0 – 32767 are ignored. The default rectangle size is 0. Power-up and reset return this value to the default.
Fill Rectangular Area The Fill Rectangular Area command determines the type of pattern used to fill the rectangle. ?*c#P #= 0 1 2 3 4 5 - Solid black or foreground color Solid white fill Shaded fill Cross-hatch fill User-defined pattern fill Current pattern fill Default = 0 Range = 0 - 5 (out-of-range values are ignored) Note If a foreground color is selected, solid, shaded, and cross-hatch patterns are printed in the foreground color.
Note The current pattern is not applied to a rectangular area unless specified by this command. The order in which data (patterns/rules, text, raster) is received is the order in which it is processed during the rasterization of the page. The fill or pattern used as the current pattern is selected using the Select Current Pattern (?*v#T) command.
Pattern Transparency for Rectangular Area Fill Pattern transparency affects how a pattern is applied to the rectangular fill area. The pattern and pattern type are selected by the Pattern ID command (?*c#G) and the Fill Rectangular Area (?*c#P) command (described earlier in this chapter). Note Source transparency has no effect on the rectangular fill area since the rectangular area is viewed as all 1’s (a solid black source image).
This example is a monochrome example and assumes the default ROP.
Rectangular Fill Examples Following are two examples that demonstrate the way to print and fill rectangular shapes. The first example demonstrates filling rectangles with solid fill and the second example demonstrates filling with a shading pattern. Solid Fill (Black/White) To print a 900 by 1500 Unit black rule (3 inches by 5 inches at 300 units-per-inch), then “white fill” a small area inside the black rectangle, perform the following steps.
7 Select the white fill and print.
Shaded Fill To print a 900 by 1500 Unit 25% shaded rectangle (3 inches by 5 inches at 300 units-per-inch), perform the following steps. 1 Position the cursor: ?*p300x400Y 2 Specify the width of the rectangle: ?*c900A 3 This sets the rectangle width to 900 PCL Units (3 inches at 300 units-per-inch). Specify the height of the rectangle: ?*c1500B 4 This moves the cursor to PCL Unit position (300, 400) within the PCL coordinate system.
5 Print the rectangular shaded area: ?*c2P Figure 5-14 EN This example prints the following: Shaded Fill Example The PCL Print Model 5-55
5-56 The PCL Print Model EN
6 Raster Graphics Introduction A raster image is a made up of a series of discrete picture elements— pixels. Pictures such as those in newspapers, television, and documents from Hewlett-Packard printers are examples of raster images. In comparison, pictures drawn with lines and geometric objects such as circles, rectangles, and polygons are termed vector graphic images.
There is a direct connection between the resolution and the size of an image. The image size is the number of pixels in the image multiplied by the number of bits used to represent a pixel. The smaller the dpi, the smaller the size of the image; the larger the dpi, the larger the size of the image. There is a tradeoff in image size versus print quality. Larger pixels give poorer print quality since diagonal lines can start looking ragged or pixelated, but the image size is small.
This pixel format is sufficient to represent black and white images, gray scale images, and color images. Furthermore, this format can represent images where the color specification is directly in the image, or where the pixel is an index into the palette. The table below shows some possible combinations of the number of components and the bits per component.
PCL 5 Color Raster Graphics The PCL 5 color raster graphics command set provides support for specifying an image's: • Dimensions • Resolution • Pixel format, also known as the pixel encoding mode • Compression mode Large image size is one of the major concerns with raster images. For example, the size of an 8 x 10 inch monochrome image at 150 dpi is 225 Kbytes. The size of a 24-bit color image with the same size and resolution is 5.4 Mbytes.
An image’s width and height define the extent of the image, that is, the number of pixels in a row and the number of rows in the image. The following commands and features eliminate the need to send blocks of zero pixel values: 1 The Y Offset command can be used to direct the printer to set all the pixel values in the given number of rows to zero. 2 If not enough data is sent for all the pixels in a row, the remaining pixels are set to zero.
Raster Graphics Command Sequence PCL raster commands include: Start Raster Graphics and End Raster Graphics commands, Transfer Raster Data by Plane and Row, Raster Compression, Raster Presentation, Raster Resolution, Raster Height and Raster Width (which define the raster area), and Raster Y Offset commands. For printing well-behaved raster graphics, the normal sequence of execution for these commands is shown below.
The emphasis in the previous command sequence is that the Raster Presentation Mode, Raster Resolution, Raster Height, and Raster Width are all set outside the start..data..end sequence of commands. Also, the entire image is sent during the start..data..end sequence, choosing the most effective compression method for each raster row of data. Raster Presentation, Raster Resolution, Raster Height, Raster Width, and Raster Compression are all true modes.
Raster Graphics Resolution Command Raster graphics can be printed at various resolutions. This command designates the resolution of subsequent raster data transfers in dots per inch. ?*t#R # = 75 100 200 150 300 600 - 75 dots-per-inch 100 dots-per-inch 200 dots-per-inch 150 dots-per-inch 300 dots-per-inch 600 dots-per-inch Default = 75 Range = 75, 100, 150, 200, 300, 600 This command must be sent prior to the start graphics command. The factory default resolution is 75 dots-per-inch.
Figure 6-2 Raster Graphics Expansion - at 300 dpi Note Rectangular area fills and character data are not affected by changes in resolution. Rectangular Area fills and character data always print at the maximum resolution, regardless of the resolution setting.
Raster Graphics Presentation Mode Command The Raster Graphics Presentation command specifies the orientation of the raster image on the logical page. ?*r#F #= 0 - Raster image prints in orientation of logical page 3 - Raster image prints along the width of the physical page Default = 3 Range = 0, 3 • A value of 0 indicates that a raster row will be printed in the positive X-direction of the PCL coordinate system. (The print direction translates the PCL coordinate system.
Raster Presentation Mode Default Graphics Margin 0 portrait logical page left bound 0 reverse portrait logical page left bound 0 landscape logical page left bound 0 reverse landscape logical page left bound 3 portrait logical page left bound 3 reverse portrait logical page left bound 3 landscape 50 dots in from the logical page top bound 3 reverse landscape 50 dots in from the logical page top bound Figure 6-3 EN Orientation Raster Graphics Presentation Mode for Portrait Orienta
Figure 6-4 Raster Graphics Presentation Mode for Landscape Orientation 6-12 Raster Graphics EN
Source Raster Height Command The Raster Height command specifies the height in raster rows of the raster area. Height is the direction perpendicular to the direction that raster rows are laid down, hence, height is subject to the current raster presentation mode and print direction (see Figure 6-5). ?*r#T # = Height in raster rows Default = N/A Range = 0 to (logical page length – current Y- position of the 0, cursor)* * Greater values default to (logical page length - current Y cursor position).
This command is ignored after the Start Raster Graphics or Transfer Raster Data commands until the next End Raster Graphics command. Note Only raster data appearing within the intersection of the logical page, the printable area, and if set, the raster width and height, is printed. Data outside the intersection is clipped. Upon receiving an End Raster Graphics (?*rC) command, the cursor position is set to the left graphics margin of the next raster row after the raster height boundary.
Source Raster Width Command The Raster Width command specifies the width in pixels of the raster area. Width is in the direction that the raster rows are laid down, hence width is subject to the current raster presentation mode and print direction (see Figure 6-6).
Figure 6-6 Maximum Raster Width 6-16 Raster Graphics EN
Start Raster Graphics Command The Start Raster Graphics command identifies the beginning of the raster data and also specifies the left graphics margin. ?*r#A #= 0 - Start graphics at default left graphics margin (X-position 0). 1 - Start graphics at current cursor position (current X-position). 2 - Raster scaling on—start at left boundary. 3 - Raster scaling on—start at CAP.
• Set Raster Graphics Resolution • Palette Commands • CID Command • Color Treatment • Render Algorithm Note An implied End Raster Graphics resets the Raster Compression Method 3 seed row, but does not reset the Raster Compression Method nor the left raster graphics margin. If source and/or transparency modes have been set, frequent start/end graphics commands in an image can result in a memory overflow condition.
Raster Y Offset Command The Raster Y Offset command moves the cursor position vertically the specified number of raster lines from the current raster position in the raster area. ?*b#Y # = Number of raster lines of vertical movement Default = N/A Range = 0 - 32767 This command is recognized only while in raster graphics mode and only within the raster area. This command zero-fills the offset area. For color printers, zero-fills are filled with the color of index 0, which is not necessarily white.
Set Compression Method Command The Set Compression Method command allows you to encode the data in a given raster transfer, either by plane or by row. These methods achieve data compression by exploiting byte-to-byte redundancies, either within a row or between rows, without regard to the pixel encoding mode of the data. While these methods reduce the amount of data transferred from the host to the printer, they do not reduce the memory requirements within the printer.
The Set Compression Mode command has the following form: ?*b#M #= 0 1 2 3 5 - Unencoded Run-length encoding Tagged Imaged File Format (TIFF) rev. 4.0 Delta row compression Adaptive compression Default = 0 Range = 0 - 3, 5 (other values are ignored) Unencoded (Method 0) This is a simple transfer of binary data without any compression. Run-length Encoding (Method 1) Run-length encoding interprets raster data in pairs of bytes.
The sign of the number in the control byte identifies whether the byte or bytes that follow represent a literal pattern or byte to be repeated. A positive number (1 to 127) indicates that the bytes are literal. A negative number (-1 to -127), represented by the twos complement, indicates a repeated byte. The value of the number, if positive (literal), identifies the number of pattern bytes which follow the control byte; if negative (repeated), it identifies the number of times to repeat the following byte.
Note Another method to calculate the number needed in the control byte for some number of repetitions is to subtract the number of desired repetitions from 256. For example, the control value for 3 repetitions (4 occurrences) of a byte is 256 minus 3 = 253. A zero or positive value in the control byte means that the subsequent byte or bytes are non-replicated bytes of data. The value of the control byte plus one indicates the number of data bytes that follow.
Run-length Encoding ?*r1A ?*b1m6W(3)U(0)A(1)T ?*rC TIFF Encoding ?*r1A ?*b2m6W(-3)U(0)A(-1)T or ?*b2m6W(-3)U(2)ATT ?*rC In the TIFF encoding example above, parenthetical expressions are used to identify control bytes. For example, the byte (-3) is shown to represent the control byte for a repetition (minus value) of 3. The actual value for this position is the decimal value 253. Additional “encoded” control bytes in this sequence include: (0) for decimal 0, (-1) for decimal 255, and (2) for decimal 2.
The command byte identifies two things: 1) the number of replacement (delta) bytes that follow; and 2) where to position the replacement byte string (the left offset). The replacement bytes are some number (up to eight bytes) of consecutive bytes that are used to create the new row from the seed row.
As mentioned, the offset contained in the lower five bits of the command byte allows for offset values from 0 to 31. Compression mode allows offsets larger than 31 bytes as follows: • An offset value of 0-30 indicates that the replacement bytes are offset from the 1st byte to the 31st byte. • A value of 31 indicates that the next byte following the command byte is an additional offset byte which adds to the first (32) offset value. This allows offset values larger than 31.
The seed row is updated by every raster graphic transfer, regardless of the compression method. This allows the delta compression method to be mixed with other methods to achieve better compression performance. Repeating a Row ?* b 0 W When using the delta compression method, it is possible to repeat or copy the previous raster row using the Raster Data Transfer command. This is accomplished by setting the Raster Data Transfer command value field to zero.
Row 3 00001111 11111111 11110000 10101010 10101010 ?*r1A – The start raster graphics command initializes the seed row to all zeros. Row 1 – ?*b3m2W(00000001)(11111111) The 3m selects the delta row compression method and the 2W indicates 2 bytes of data to follow. The first three bits of the first data byte, the command byte, signify a single byte replacement (all three bits are 0). The next five bits indicate an offset of 1 byte from the current position.
The size of a block is limited to 32,767 bytes. (32,767 bytes is the number of compressed bytes and not the size of the uncompressed data). To transfer greater than 32,767 bytes, send multiple blocks. Adaptive compression uses three control bytes at the beginning of each row within the block. The first of these bytes, the command byte, identifies the type of compression for the row. The two following bytes identify the number of bytes or rows involved.
For command byte values 0 - 3, the two <# of bytes/rows> bytes specify the number of bytes (row length) for the row. For command byte values 4 and 5, these bytes identify the number of empty or duplicate rows to print. The maximum value for these two bytes is 65,535; however, the image is clipped to the logical page. Thus, the value of these bytes should not exceed the maximum number of bytes/rows that can be printed on the current logical page size.
Adaptive Compression Operation Hints Note Some HP LaserJet printers perform internal compression techniques to support full-page graphics. Refer to Chapter 1 of the PCL 5 Comparison Guide for specifics. • The compression methods cannot be mixed within one raster row. A raster row must be compressed using only one method. • The cursor position is updated with each row of the raster block. The cursor position is also incremented when a block count of less than 3 is sent.
• For Method 3—since delta row compression requires that the seed row be available whenever raster graphics mode is entered, the seed row is initialized to zeros upon raster graphics mode entry (?*r#A). The seed row is also initialized upon receipt and completion of each raster block. • For Method 3—if the row length terminates the data before the control byte value is satisfied (literal byte count greater than row length), the data following the control byte, if any, is printed as text.
Transfer Raster Data by Plane This command sends a plane of data to the printer and advances to the next plane (not to the next row). ? * b # V [raster data] Default = N/A Range = 0 to 32767 The value field (#) identifies the number of bytes in the plane. The number of planes per row is specified by the Simple Color command (?*r#U) or the Configure Image Data command (?*v#W), depending on which color mode is used. The first plane sent represents the least significant bit in the pixel.
The value field (#) identifies the number of bytes in the raster row. These bytes are interpreted as one row of raster graphics data printed at the current Y position at the left raster graphics margin. Upon completion of this command, the cursor position is at the beginning of the next raster row at the left raster graphics margin. Raster graphics are independent of the text area and perforation skip mode—these boundaries are ignored.
End Raster Graphics Command The End Raster Graphics command signifies the end of a raster graphic data transfer. ?*rC Receipt of this command causes 5 operations: • Resets the raster compression seed row to zeros. • Moves the cursor to the raster row immediately following the end of the raster area (if a source raster height was specified). • Allows raster commands which were previously locked out to be processed. • Sets compression mode to 0 (no compression).
Raster Scaling Raster scaling provides the ability to enlarge or reduce raster images using the Destination Raster Width and Destination Raster Height commands. The Start Raster command (?*r#A) with a value field of 2 or 3 turns on scale mode. Scaling is independent of device resolution. Note To use raster scaling, the Configure Image Data command (?*r#W) must be sent prior to the Start Raster command (?*r#A), which must have a value field of 2 or 3 to enable scaling.
Destination Raster Width The Destination Raster Width command defines the width in decipoints of the destination raster picture denoted by the next Start Raster command, which must have a value field of 2 or 3 (?*r2A or ?*r3A). ?*t#H # = Width (in decipoints) Default = Right logical page boundary minus left graphics margin Range = 0 – 32767.0000 (values outside the range are ignored) Zero or absent values default the destination width to a value that preserves isotropic scaling.
Raster Graphics Example To transfer an unencoded arrow-shaped raster graphic image (see Figure 6-7) in the shape of an arrow, perform the following steps (notice the well-behaved raster sequence is utilized): 1 Position the cursor: ?*p300x400Y 2 Specify Raster Presentation Mode 0: ?*r0F 3 Specify a 32-pixel raster width. Specify the left raster graphics margin: ?*r1A 7 Specify a raster height of 32 pixels (32 rows of raster data).
8 Specify the raster compression mode: ?*b0M 9 No compression (unencoded). Transfer the raster data to the printer: Divide the image into dot rows and transfer each dot row to the printer as a string of bytes, as illustrated on the following page. 10 Signify the end of the raster image transfer: ?*rC This example prints the arrow as shown in Figure 6-7.
Example of Raster Graphic Image Data Raster Image Data Dot Row byte 1 byte 2 Command Data byte 3 byte 4 17 11111111 11111111 11111111 11111111 18 11111111 11111111 11111111 11111110 19 11111111 11111111 11111111 11111100 20 11111111 11111111 11111111 11111000 21 11111111 11111111 11111111 11110000 22 11111111 11111111 11111111 11100000 23 11111111 11111111 11111111 11000000 24 00000000 00000000 11111111 10000000 25 00000000 00000000 11111111 00000000 26 00000000 00000000 111
Figure 6-7 EN Example of Raster Graphic Image Data Raster Graphics 6-41
Color Raster Graphics Example This example demonstrates the Indexed by Pixel PEM of the CID command. It produces a one inch wide by one half inch high image of one inch high by 0.1 inch wide colored vertical bars. The pixels in the image are eight byte indices, repeatedly ranging from 0 to 7, thus giving the different colored vertical bars.
Looking at the PCL commands, you'll notice that the first row is sent unencoded and then the remaining rows replicated by switching to delta row encoding and sending 299 zero rows. This method depends on two features of the PCL 5 command set: 1 The 1st row became the seed row at the end of the first row transfer command. 2 When in Delta Row compression mode, zero length transfers cause the seed row to be replicated.
W\e*b0W\e*b0W\e*b0W\e*b0W\e*b0W\e*b0W\e*b0W\e*b0W\e*b0W\e*b0 W\e*b0W\e*b0W\e*b0W\e*b0W\e*b0W\e*b0W\e*b0W\e*b0W\e*b0W\e*b0 W\e*b0W\e*b0W\e*b0W\e*b0W\e*b0W\e*b0W\e*b0W\e*b0W\e*b0W\e*b0 W\e*b0W\e*b0W\e*b0W\e*b0W\e*b0W\e*b0W\e*b0W\e*b0W\e*b0W\e*b0 W\e*b0W\e*b0W\e*b0W\e*b0W\e*b0W\e*b0W\e*b0W\e*b0W\e*b0W\e*b0 W\e*b0W\e*b0W\e*b0W\e*b0W\e*b0W\e*b0W\e*b0W\e*b0W\e*b0W\e*b0 W\e*b0W\e*b0W\e*b0W\e*b0W\e*b0W\e*b0W\e*b0W\e*b0W\e*b0W\e*b0 W\e*b0W\e*b0W\e*b0W\e*b0W\e*b0W\e*b0W\e*b0W\e*b0W\e*b0W\e*b0 W\e*b0W\e*b0W\e*b0W\e*b0
7 Color Vector Graphics (HP-GL/2) Introduction The process involved in using HP-GL/2 with the HP Color LaserJet family or DeskJet 1200C and 1600C color printers is nearly identical with using HP-GL/2 on other color printers or plotters. However, these two color printers add a few HP-GL/2 commands and expand the functionality of some existing commands. This chapter describes these commands and other pertinent points to keep in mind when using HP-GL/2 with these color printers.
Enter HP-GL/2 Mode This command causes the printer to interpret subsequent commands as HP-GL/2 commands, instead of PCL printer language commands.
z The ?%#A command closes HP-GL/2, prints the current page, and performs an ?E before entering PCL. z The default HP-GL/2 orientation is reverse landscape. z Hard-clip limits are equal to the printable area. z The ?E command functions as usual. When the single-context mode is used (?%–1B), the following steps should be followed: 1 Enter HP-GL/2 mode using the ?%–1B command. 2 Transmit one or more HP-GL/2 drawings. 3 Exit HP-GL/2 mode (?%#A).
• The PCL palette and color configuration are transferred between contexts. • The current logical operation and pixel placement settings are transferred between contexts. • The current active position (CAP) is transferred between HP-GL/2 and PCL (for ?%1B and ?%3B only). • The PCL orientation determines the HP-GL/2 orientation. In PCL mode, the Enter HP-GL/2 Mode command must be executed, except when in display functions mode or within a binary data transfer. HP-GL/2 ignores this command.
• Redefining the PCL Picture Frame size or setting the anchor point: z Defaults P1 and P2 (IP, IR commands) z Resets the soft-clip window (IW) to the PCL Picture Frame boundaries. z Clears the polygon buffer (PM0, PM2) z Updates the current pen position to the lower-left corner of the picture frame (P1). • Setting an HP-GL/2 plot size: z Changes the picture frame scaling factor.
MC (Merge Control) The MC command controls the color of pixels where two or more page marking primitives intersect on the page. This command supports all 256 Microsoft Windows ternary (ROP3) raster operation codes. A common application of the MC command is the rendering of complex polygon fill patterns. Raster Operations specify how source, destination, and patterns are combined to produce final images.
• Opcode — Specifies the logical operations performed on a source, destination, and pattern prior to drawing the final image. These raster opcodes (ROPs) are listed on the following pages in reverse polish notation (RPN) using the following abbreviations: D — Destination S — Source T — Texture a — and n — not o — or x — exclusive or For example, when mode = 0, the opcode default is 252, which is the logical function TSo (Texture OR Source).
Note When using the MC command, some pattern types will not produce the expected ROP result. This only occurs when using the FT (Fill Type) command pattern types 1, 2, 3, and 4, and when the ROP includes an XOR operation. (This problem is due to the fact that these patterns are the result of a vector operation and do not produce raster data for use by a ROP operation.) All other Fill Type command patterns (types, 10, 11, 21, or 22) operate as expected.
Table 7-1.
Table 7-1.
Table 7-1.
Table 7-1.
Table 7-1.
PC (Pen Color) This command changes the pen color in a palette created by the IN or CID command (?*v#W). The PC command defaults the colors of all pens as indicated in the table below.
The “PC;” command defaults the colors of all pens as shown in the table below. The “PC pen;” command defaults the number of pens as shown in the table on the following page for an HP-GL/2 palette. When color device palettes larger than 8 pens default, the first 8 pen colors are as defined for a palette of 8; all remaining pen colors are device- dependent. If the palette is a non-default palette, it defaults in accordance with the default palettes in Chapter 4. No.
Note In the “shading” Fill Type command (FT10;), the shading levels are mapped between white (0% shading) and the equivalent gray level for the currently selected pen (100% shading). In the “HP-GL/2 user-defined” Fill Type command (FT11;), each pixel in the RF pattern is rounded to white or black based on the equivalent gray level of the pen number for that pixel. This rounding should use a low enough white/black threshold so that yellow will round to black.
NP (Number of Pens) The NP command resizes the palette after the IN or ?*v#W commands. NP [n;] or NP[;] Parameter n Format clamped integer Functional Range 2 to 32768 Parameter Default device-dependent* * The default palette size for the HP color printers is 8. • n — the parameter n denotes the size of the HP-GL/2 palette, where n is a power of two. If n is not a power of two, the next larger power of two is used.
If the currently selected pen is outside the range of the new palette size, the SP command modulo function is applied to obtain a pen number which will index into the new palette; this clears the current residue (the unused portion of a pattern) and terminates any sequence of continuous vectors. For more information, see the descriptions of the Line Attribute (LA) and Line Type (LT) commands in the PCL 5 Printer Language Technical Reference Manual. The number of pens is defaulted by an IN command.
CR (Color Range) The CR command sets the range for specifying relative color data. Note This command is only supported by the HP Color LaserJet, Color LaserJet 5, 5M, and DeskJet printers. It is not supported by the HP Color LaserJet 4500 or 8500 printers.
PP (Pixel Placement) When printing, the printer places pixels at the intersection of the squares of a theoretical, device-dependent grid covering the printable area on a page. When the sides of two HP-GL/2 polygons touch each other, the pixels along the border may be printed twice or not at all— depending on the logical operation in effect. For example, if a source rectangle consisting of all 1's is XORed with a destination consisting of all 1’s, a white rectangle is printed.
Figure 7-1 EN Pixel Placement Color Vector Graphics (HP-GL/2) 7-21
PP, Pixel Placement Command The Pixel Placement (PP) command controls how pixels are placed on the layout grid during polygon fills. The two pixel placement modes are grid intersection or grid centered. PP [mode;] Parameter mode Format clamped integer Functional Range 0 or 1 Parameter Default 0 (grid intersection) • mode 0 1 grid intersection; device draws pixels centered at grid intersections (see Figure 7-1).
A Color Printing Overview (Color LaserJet, 5, 5M, DeskJet) Introduction This appendix provides an overview of the way color is used in the HP Color LaserJet, Color LaserJet 5, 5M, DeskJet 1200C, and DeskJet 1600C printers. It previews the remaining appendices, which describe the specific details of Hewlett-Packard color printing. Note The features described in these appendices are a superset of those supported by the HP Color LaserJet, Color LaserJet 5, 5M and DeskJet printers.
When printing color pages, a user can choose one of several color modes, depending on the desired results. Each color mode has a palette associated with it. Simple Color Mode provides a palette of fully saturated colors whose colors are similar to those of a plotter’s pen colors. The palette is nonprogrammable, and is intended for simple printing of items such as bar and pie charts. For applications requiring different or more specific colors, the printer offers the PCL Imaging and HP-GL/2 Imaging Modes.
Color Concepts This section describes some of the concepts and terminology used in this chapter, such as palettes, raster vs. non-raster color, device-independent vs. device-dependent color, black and white references, color selection, pixel encoding, and color modes. Palettes A palette is a collection of colors that are selected by their index numbers. You can create your own palette or choose from one of several fixed palettes.
Device-Dependent vs. Device-Independent Color Device-dependent color spaces are relative to the device’s ability to produce specific colors. For example, if red is specified in a device-dependent color space, two different printers will combine the same amounts of cyan, magenta, yellow, and black toner to produce the color, but the results will be different because of the different properties of the toner.
Example: Assuming the white and black references are set as follows: Scenario 1 White Reference Black Reference red = 63 red = 0 green = 63 green = 0 blue = 63 blue = 0 Scenario 2 White Reference Black Reference red = 63 red = 4 green = 127 green = 0 blue = 31 blue = 0 Using these reference values, 50% blue for scenario 1 is 31, and 50% blue for scenario 2 is 15.
The number of colors in the palette dictates the number of bits per pixel of raster data required to specify an index number. For example, to specify 256 colors you need to send 8 bits of raster data per pixel (28 = 256). In direct selection, colors are specified using the proportions of their primary components. For example, using a 24-bit-per- pixel representation, the color specified by (0xff, 0xf0, 0x00) for red, green, and blue would print a slightly red-tinted yellow.
Encoding by Pixel When encoding by pixel, each pixel is fully specified before any bits are sent for the next pixel. For example, if four bits are needed to define a pixel, then every group of four bits in the data stream defines a pixel. The underlined (c4 . . . c1) group below defines the second pixel in the first row. ?*b#W ?*b#W row 1 row 2 b4 b3 b2 b1 c4 c3 c2 c1 . . . b4 b3 b2 b1 . . . The table below shows the four PCL options for selecting colors and encoding color raster data.
Device-Dependent Color Spaces The following PCL commands can alter color processing for device-dependent color spaces: • Rendering Algorithm (?*t#J) • Gamma Correction (?*t#I) • Color Lookup Tables (?*l#W) • Configure Image Data (?*v#W) • Simple Color (?*r#U) • Monochrome Print Mode (?&b#M) Color lookup tables or gamma correction (which are mutually exclusive) can modify the mapping of input to output.
• Cluster Ordered Dither (?*t7J, ?*t8J) • Ordered Dither (?*t11J, ?*t12J) Color processing reverts to device-dependent processing if the render algorithm is changed from one of the above. This is because extensive device characterization is necessary to achieve device-independence—calibration must be based on known parameters that affect the device's color gamut.
Device-Independent Color The PCL language characterizes color as either device-dependent or device-independent. Both categories encompass many color spaces, each with unique characteristics. Device-Dependent Color Device-dependent color is relative to the device's inherent characteristics. For example, the colors produced by plotters are relative to the color of the installed plotter pens. Pen color varies considerably, especially as pens wear out, changing the color of the output.
With proper calibration, any device can provide a transform from device-independent color space to the device’s own color space, producing output from different devices that have the same color appearance. For example, if a monitor’s parameters are known (gamma, gain, chromaticity coordinates for each primary, and the white point), the monitor’s RGB pixel information can be transformed into device-independent color.
Color Appearance Matching Color appearance matching goes beyond true color matching by including adjustments for the dynamic ranges of the devices, so the user's intent is maintained. For example, the white areas of a page shown on a monitor display screen would be printed as white on a printed page because the user specified white, even though the screen cannot duplicate a white that truly matches white paper.
Illumination Models Illumination sources have different spectral distributions, causing colors to appear differently under one light source compared to another. For example, printed colors that look normal in natural sunlight shift in hue when viewed under fluorescent and tungsten lighting. The PCL language allows the user to compensate for the differences in viewing illumination using the Viewing Illuminant command. It allows the user to select different illuminations.
Processing Color Documents To process a color page, PCL provides ways of specifying and modifying color so that the printed result appears as the user desires. This section provides a conceptual overview of the process. Non-Raster Color vs.
Color Processing Functions Given these two color uses, page marking primitives and color raster data, color processing must: • Convert color attributes to an internal representation that can be poured through the page marking stencil onto the destination via some logical operation. • Convert multiple-bit-per-pixel color raster to an internal representation that can be merged into the destination via some logical operation.
A-16 Color Printing Overview (Color LaserJet, 5, 5M, DeskJet) EN
B Using Color Modes (Color LaserJet, 5, 5M, DeskJet) This appendix describes how color commands were supported on the following printers: • HP Color LaserJet, Color LaserJet 5 / 5M • HP DeskJet 1200C and 1600C Since then, the PCL 5 color command set has been simplified as described in Chapter 1. Appendices A through D and Chapters 5 through 7 describe the color commands as they were supported for these printers.
Introduction The PCL printer language has four color modes: • Black-and-White • Simple Color • PCL Imaging • HP-GL/2 Imaging PCL allows you to use any mode or combination of modes to accomplish your printing objectives most efficiently. All four of the color modes create a palette. The palette for each mode is discussed in the section describing that mode, and also in Appendix C (“Using Palettes”). Black-and-White Mode (Default) Black-and-White Mode is the default color mode.
HP-GL/2 Imaging Mode In HP-GL/2, the Initialize (IN) command starts color imaging and performs the following: • Sets the pixel encoding mode to index by plane. • Sets bits per index to 3. • Creates an 8-pen palette that is reprogrammable in either PCL or HP-GL/2 contexts (see Appendix C, “Using Palettes,” for more information).
Simple Color Mode The Simple Color command (?*r#U) specifies color selection from a fixed palette. RGB or CMY raster data must be sent by plane (?*b#V) as well as by row (?*b#W). The last plane in each row is sent using the ?*b#W command; all other planes are sent using the ?*b#V command. In Simple Color mode, the pixel encoding mode is always indexed planar. Simple Color Command The Simple Color command creates a fixed-size palette, whose color specification cannot be modified.
The Simple Color palettes are shown below: Single Plane (value = 1) Index Color 0 White 1 Black 3-Plane RGB (value = 3) Index Color 0 Black 1 Red 2 Green 3 Yellow 4 Blue 5 Magenta 6 Cyan 7 White 3-Plane CMY (value = –3) EN Index Color 0 White 1 Cyan 2 Magenta 3 Blue 4 Yellow 5 Green 6 Red 7 Black Using Color Modes (Color LaserJet, 5, 5M, DeskJet) B-5
PCL Imaging Mode The PCL Imaging mode, entered using the Configure Image Data (CID) command (?*v#W), creates a variable-sized programmable palette. It provides halftoning in the printer, with multiple color spaces, pixel encoding modes, and reprogrammable palettes. Configure Image Data (CID) Command The CID command provides configuration information for creating palettes and transmitting raster data.
Common 6-Byte Header The short and long forms of the CID command use a common 6-byte header, regardless of which color space is specified. The header data fields, whose meaning may vary according to the color spaces, are present in all color space specifications. The short form and long form of the CID command are explained separately in the following pages.
Note Colorimetric RGB color spaces are based on the 1931 standard 2-degree observer and specified by CIE xy chromaticity coordinates. They use the standard D6500 viewing illuminant and a 45-degree illumination model with a 0-degree collector geometry for reflective data. CIE L*a*b* is the CIE 1976 Uniform Color Space based on the 1931 standard 2-degree observer, and using a 45-degree illumination model with a 0-degree collector geometry for reflective data.
You need one plane or one bit/pixel for each power of two colors in the palette. For example, a 256-color palette requires 8 planes or 8 bits/pixel (28 = 256). Note Direct pixel encoding modes (2, 3) cannot be compressed using raster compression modes 1 or 2. Planar pixel encoding modes (0, 2) cannot be compressed using raster compression mode 5. MODE 0: INDEXED BY PLANE In mode 0 (default), successive planes of data are sent for each raster row. A plane contains one bit for each pixel in a row.
Example: ?*v6W 00 00 03 08 08 08 # Binary data for CID represented in hex. Sets color space to RGB, pixel encoding mode to 0, palette size to 8 (3 planes), last 3 bytes ignored. ?*r1A ?*b1V10110000 . . . # Start raster. # Transfer plane 1 (the first bit for each pixel in the first row). Combining each bit with its corresponding bit in the other planes forms the palette index number for that pixel. ?*b1V01110000 . . . # Transfer plane 2 (the second bit for each pixel in the row). ?*b1W10101000 . . .
Example: ?*v6W 00 01 04 04 04 04 # Binary data for CID represented in hexadecimal. Sets color space to RGB, pixel encoding mode to 1, palette size to 16 (4 bits to address palette index). Last 3 bytes ignored. ?*r1A ?*b1W45 # Start raster. # Most significant nibble selects palette index 4 for the first pixel. Second pixel is set to index 5. Move to the next row. ?*b1W6A # First pixel is index 6, second pixel is index 10. Move to the next row. ?*b1W03 # First pixel is index 0, second pixel is index 3.
Example: ?*v6W 00 02 01 01 01 01 # Binary data for CID represented in hex. Sets color space to RGB, pixel encoding mode to 2. Palette size is ignored because this is a direct selection, not indexed. Last 3 bytes are always 1 for this mode. ?*r1A ?*b1V10110000 . . . # Start raster. # Transfer plane for primary color 1. Each bit turns on or off the red primary for the pixel defined by the corresponding bits in each plane. ?*b1V01110000 . . . # Transfer plane for primary color 2.
Example: ?*v6W 00 03 00 08 08 08 # Binary data for CID represented in hex. Sets color space to RGB, pixel encoding mode to 3. Palette size is ignored. Send 8 bits to address each primary value for a pixel. ?*r1A ?*b3W 45 06 30 # Start raster. # Each byte sets a primary value for the first pixel and moves to the next row (45 specifies the red, 06 the green, and 30 the blue component value of that pixel).
A value of 0 defaults the black and white reference values for primary #1 according to the color space. Byte 4 (Number of Bits for Primary #2) This byte is ignored in pixel encoding modes 0 and 1, but affects the black and white references in device-dependent color spaces. In Device RGB, the black reference for primary #2 is set to 0, and the white reference is set to 2n – 1, where n is the number of bits for primary #2. These references are reversed in Device CMY color space.
Short Form of CID Command (Configure Image Data) The Short Form of the CID command involves sending just the common 6-byte header. By changing the value of byte 0 (color space), the short form can specify the following five color spaces: • Device RGB • Device CMY • CIE L*a*b* ?*v6W[0x00, . . . ] ?*v6W[0x01, . . . ] ?*v6W[0x03, . . . ] The following data ranges are allowed in CIE L*a*b*. Hue is preserved when out-of-range data is clipped. L* = 0.0 to 100.0 a* = –100.0 to 100.0 b* = –100.0 to 100.
• Luminance-Chrominance (YUV) ?*v6W[0x04, . . . ] YUV, which is a linear transformation from SMPTE RGB, is the default Luminance-Chrominance color space. The short form allows the following ranges: Y = 0.0 to 1.0 U = –0.89 to 0.89 V = –0.70 to 0.70 Note Luminance-Chrominance color space support is at HP Color LaserJet level for HP Color LaserJet 5 and 5M printers. Data Range Scaling White and black references define the encoding range for device-dependent color spaces.
Long Form of CID Command (Configure Image Data) In addition to the short form, there is also a long form of the CID command for each color space. In device-independent color spaces, the long form can specify primaries other than the defaults provided by the short form. For example, a Sony Trinitron RGB primary base can be selected for Colorimetric RGB instead of the default non-linear SMPTE RGB primaries.
Device CMY (Long Form) The long form for the Device CMY color space (value field is 18) provides explicit entry of black and white references (range is –32767 to 32767). Black and white references are used in the direct pixel encoding modes (2,3) to set relative limits for raster data; they are also used when specifying the primary components of new palette entries (?*v#A, ?*v#B, ?*v#C). Black and white references have no effect on the default CID palette colors.
Note Although the data ranges may extend beyond the default data ranges specified in the short form of the CID command, the printer will clip the data to the short form data ranges. Maximum and minimum values are specified for each primary color. Floating point data must be linearly scaled (y = mx b) to the range 0 – 255. Since a* and b* have no theoretical limits, L*a*b* data may be sent outside CID constraints. Then data is clipped to preserve hue and compressed to the device's printable gamut.
FLOATING POINT FORMAT The following format is used for device-independent color floating point specifications: 31 30 Sign 23 22 Exponent 0 Fractional Portion The above single-precision, 32-bit floating point specification is fully compliant with the IEEE Floating Point Formats. Colorimetric RGB (Long Form) The long form for Colorimetric RGB allows specifications other than the default non-linear SMPTE RGB with a 2.2 gamma and 1.0 gain.
Byte EN 15 (msb) 8 7 (lsb) 0 Byte 22 x Chromaticity for blue primary (msw) 23 24 x Chromaticity for blue primary (lsw) 25 26 y Chromaticity for blue primary (msw) 27 28 y Chromaticity for blue primary (lsw) 29 30 x Chromaticity for white point (msw) 31 32 x Chromaticity for white point (lsw) 33 34 y Chromaticity for white point (msw) 35 36 y Chromaticity for white point (lsw) 37 38 Gamma for red primary (msw) 39 40 Gamma for red primary (lsw) 41 42 Gain for red primary
Byte Note 15 (msb) 8 7 (lsb) 0 Byte 76 Maximum green value (lsw) 77 78 Minimum blue value (msw) 79 80 Minimum blue value (lsw) 81 82 Maximum blue value (msw) 83 84 Maximum blue value (lsw) 85 HP Color LaserJet 5 and 5M printers bypass the Colorimetric RGB process. In place of it, a device-dependent RGB process is substituted with a Screen Match color table.
Byte EN 15 (msb) 8 7 (lsb) 0 Byte 22 Encoding for primary #2 G (msw) 23 24 Encoding for primary #2 G (lsw) 25 26 Encoding for primary #2 B (msw) 27 28 Encoding for primary #2 B (lsw) 29 30 Encoding for primary #3 R (msw) 31 32 Encoding for primary #3 R (lsw) 33 34 Encoding for primary #3G (msw) 35 36 Encoding for primary #3 G (lsw) 37 38 Encoding for primary #3 B (msw) 39 40 Encoding for primary #3 B (lsw) 41 42 Minimum primary #1 value (msw) 43 44 Minimum primary #1
Byte Note 15 (msb) 8 7 (lsb) 0 Byte 76 x Chromaticity for green primary (lsw) 77 78 y Chromaticity for green primary (msw) 79 80 y Chromaticity for green primary (lsw) 81 82 x Chromaticity for blue primary (msw) 83 84 x Chromaticity for blue primary (lsw) 85 86 y Chromaticity for blue primary (msw) 87 88 y Chromaticity for blue primary (lsw) 89 90 x Chromaticity for white point (msw) 91 92 x Chromaticity for white point (lsw) 93 94 y Chromaticity for white point (msw) 95
Examples Using the CID Command The following examples illustrate using the CID command's short and long forms for each color space. For clarity, data is shown as ASCII, rather than binary and the CID command (?*v#W) is shown as “CID”. The following format is used: CID ( data , data , . . .
CIE L*a*b* SHORT FORM CID(3,3,0,8,8,8) L*a*b*, direct 8 bits/primary LONG FORM CID(3,3,0,8,8,8, 0.0, 100.0, –100.0, 100.0, –100.0, 100.0) L*a*b*, direct 8 bits/primary L* data encoding a* data encoding b* data encoding Non-Linear SMPTE RGB, 2.2 Gamma, 1.0 Gain SHORT FORM CID(2,3,0,8,8,8) RGB, direct 8 bits/primary LONG FORM CID(2,3,0,8,8,8, 0.64, 0.34, 0.31, 0.60, 0.16, 0.07, 0.3127, 0.3290, 2.2, 1.0, 2.2, 1.0, 2.2, 1.0, 0.0, 1.0, 0.0, 1.0, 0.0, 1.
LONG FORM CID(2,3,0,8,8,8 0.62, 0.34, 0.30, 0.58, 0.15, 0.09, 0.2800, 0.2933, 2.3, 1.19, 2.3, 1.19, 2.3, 1.19, 0.0, 255.0, 0.0, 255.0, 0.0, 255.0) RGB, direct 8 bits/primary | | Chromaticity coordinates | for RGB | White Point * * Gamma and gain for RGB * | | Data range encoding | YUV Chrominance-Luminance Color Space SHORT FORM CID(4,3,0,8,8,8) YUV, direct 8 bits/primary YUV Chrominance-Luminance with Sony Trinitron LONG FORM CID(2,3,0,8,8,8 0.30,0.59,0.11, –0.30,0.59,0.89, 0.70,–0.59,–0.11, 0.0,255.
HP-GL/2 Imaging Mode The HP-GL/2 Imaging Mode provides a way of using vector commands in printing documents. Although the default PCL and HP-GL/2 palettes are not the same, when transferring from PCL to HP-GL/2, active palette information does stay the same. You can switch between PCL and HP-GL/2 and use the same palette, and you can also modify palettes using either PCL or HP-GL/2.
C Using Palettes (Color LaserJet, 5, 5M, DeskJet) Introduction A palette is a collection of color specifications selected using index numbers. The figure below illustrates a palette. Each palette entry associates an index number with three primary color components. For HP-GL/2 purposes only, a pen width is also associated with each palette entry.
In non-raster mode, the current palette contains all the colors available to the printer. In raster mode, indexed color selection uses the palette, but direct selection does not. Default palettes are created by all the PCL color modes (Black and White, Simple Color, PCL Imaging, and HP-GL/2 Imaging). The active palette may be modified when in the PCL Imaging or HP-GL/2 imaging modes, but not when in the Simple Color or Black and White modes.
Saving the Palette The current palette is destroyed when a new palette is created. The Push/Pop Palette command (?*p#P) can save (push) the current palette and then restore (pop) it. Push/Pop Palette Command This command pushes or pops the palette from the palette stack. ?*p#P # = 0 - Push (save) palette 1 - Pop (restore) palette Default = 0 Range = 0, 1 (invalid values are ignored) A value of 0 (?*p0P) pushes a copy of the active palette onto the palette stack.
Pushing a palette does not save the following parameters. • Foreground color • Color components: 1st, 2nd, and 3rd • Finish mode • Monochrome print mode The palette stack depth is limited by printer memory. Attempts to push a palette with insufficient memory cause an out-of-memory error. Attempts to pop from an empty stack are ignored. Macros can push and pop palettes.
Palette Management by ID All palettes have a unique ID (identification number). The default black and white palette created on power-up or ?E has an ID of 0. Palette management by ID lets applications have multiple palettes. As shown below, multiple palettes can exist in two areas: the palette stack and the palette store. The stack holds palettes that are pushed via a Push/Pop Palette command; the store holds palettes having palette IDs.
Management by ID allows applications to tag data, have multiple raster configurations, and have palettes for different color spaces—all without reconfiguring the active palette. For example, one palette can be created for PCL text, one for HP-GL/2 primitives, one for simple raster, and one for 24-bit raster. The application can then switch between palettes according to what is being sent to the printer. Selecting a new active palette changes the PCL graphics state.
This command can be used to de-select the active palette and select as the new active palette a palette created by the Palette Control command (?&p#C). For example, to copy the active palette to an ID of 44 and select the new palette to use or modify, send ?&p44i6c44S. When a palette creation command is received such as Configure Image Data (?*v#W), Simple Color (?*r#U), or an HP-GL/2 IN, the created palette overwrites the active palette and is assigned the current palette select ID, which is unchanged.
Palette Control ID The Palette Control ID command specifies the ID number to be used by the Palette Control Command. ?&p#I # = Palette ID number Default = 0 Range = 0 to 32767 (command is ignored for out- of-range values) The ID number specified by this command is saved as the palette control ID in the current modified print environment and is used by the Palette Control command (?&p#C). ?E or power-up resets the palette control ID to 0, which is then the default black and white palette ID.
Palette Control The Palette Control command provides a mechanism for marking and deletion of palettes.
The Palette Control command provides a way of managing system memory by deleting palettes in either the stack or store that are no longer in use. Palette Control that is exercised during macros can have significant impact on palettes that exist within the system. Deleting all palettes, or those on the stack, or the current palette, or all those except on the stack can have adverse effects when the macro is exited.
Simple Color Palettes The Simple Color command (?*r#U) provides a quick way to select colors from a fixed, non-programmable palette. The Simple Color command overwrites the current palette with one of the fixed palettes below. When the Simple Color command is in effect, the PCL and HP-GL/2 commands that modify a palette entry (NP, CR, PC, ?*v#A, ?*v#B, ?*v#C, ?*v*I, ?*t*I) are locked out. A popped simple color palette cannot be modified and the pixel encoding mode reverts to “index by plane”.
3-Plane CMY (value = –3) Index Color 0 White 1 Cyan 2 Magenta 3 Blue 4 Yellow 5 Green 6 Red 7 Black C-12 Using Palettes (Color LaserJet, 5, 5M, DeskJet) EN
CID Color Palettes The Configure Image Data command, explained in detail in Appendix B, creates a palette based upon the parameters in its data field. CID-created palettes are programmable: any entry can be reassigned a different color using PCL commands (?*v#A, ?*v#B, ?*v#C, ?*v*I) or HP-GL/2 commands (CR, PC, NP). Default palettes vary by color space. Device RGB Palettes The black and white references specified by the CID command have no effect on the default palettes below.
Bits/Index = 3 through 8 Index Color 0 Black 1 Red 2 Green 3 Yellow 4 Blue 5 Magenta 6 Cyan 7 White n>7 Black C-14 Using Palettes (Color LaserJet, 5, 5M, DeskJet) EN
Device CMY and Device-Independent Palettes A CID command specifying either a device-independent color space or the Device CMY color space creates the same default palettes. This is because device-independent colors are transformed into the printer's native space, Device CMY.
HP-GL/2 Palettes Regardless of the color space, a default PCL palette is always different than a default HP-GL/2 palette. The following table shows the default palettes established in HP-GL/2.
Eight Pens EN Pen Number Color 0 White 1 Black 2 Red 3 Green 4 Yellow 5 Blue 6 Magenta 7 Cyan n>7 Black Using Palettes (Color LaserJet, 5, 5M, DeskJet) C-17
Foreground Color All PCL marking entities utilize “foreground” color, which is selected from the current palette using the Foreground Color command (?*v#S). Foreground color interacts with raster color depending on the print model commands in effect. Foreground Color Command The Foreground Color command sets the foreground color to the specified index of the current palette.
Note Foreground color interacts with color raster images. In the printer, all color raster is resolved into three binary raster planes of CMY. Foreground color is applied to these planes, modifying the color image. For no interaction, set foreground color to black when sending color raster images.
Programming Color Palettes Except for the default black and white palette or the Simple Color palettes (?*r#U), palette entries can be modified. The three primary components of a color are specified and the resulting color is assigned to the palette entry indicated by ?*v#I. In the explanation below, the term “component” refers to the color space primary colors.
Color Component Three This command specifies the third primary of the palette entry designated by the Assign Color Index command. ?*v#C # = Third Component Default = 0 Range = –32767.0000 to 32767.0000 (up to 4 decimal places; command is ignored for invalid configurations) The Assign Color Index command actually applies this value and then resets it to 0. Assign Color Index This command assigns the three current color components to the specified palette index number.
C-22 Using Palettes (Color LaserJet, 5, 5M, DeskJet) EN
D Modifying Output Color (Color LaserJet, 5, 5M, DeskJet) Introduction The previous appendices of this manual have been concerned with giving an overview of the color printing process, choosing color modes, and using palettes. This portion of the manual explains how color can be modified to produce a desired result, from using halftone render algorithms to change the way color is rendered, to compensating for the yellow cast caused by a tungsten light source in a photograph.
• The Driver Configuration command provides a way for a driver to calibrate the output by adjusting color lightness, saturation, and color map information. All of these methods of modifying output color are explained in the following sections.
Halftone Render Algorithms The HP color printers have the capability of applying different halftone render algorithms to achieve the desired output on the printed image. Render algorithms allow you to change the characteristics of the image by changing the way pixels are rendered. Each halftone render algorithm produces a different affect on the output, varying the texture and color appearance of the printed image.
16 - Monochrome continuous tone detail 300 lpi 17 - Monochrome continuous tone smooth 150 lpi 18 - Continuous tone basic 100 lpi 19 - Monochrome continuous tone basic 100 lpi Default = 3 Range = 0 to 19 (invalid values are ignored; values 1, 2, 9, and 10 are ignored for device independent color) Snap to Primaries This algorithm converts each component of a color specification to its corresponding primary color.
Ordered Dither and Clustered Ordered Dither The ordered dither or cluster ordered dither causes a pixel to be intensified at a point (x,y) depending on the desired intensity, I(x,y), and on an n x n dither matrix, D, where: i = x modulo n j = y modulo n For RGB color spaces, if I(x,y) < D(i, j), the point corresponding to (x,y) is intensified; otherwise it is not. The intensity of each primary color is determined according to this scheme.
Non-Continuous Tone Algorithms HP Color LaserJet 5 and 5M printers remap non-continuous tone render algorithms into continuous tone algorithms.
A user-defined matrix is defined in additive colors (RGB values). The dither matrix pixels are defined in terms of device-dependent resolution. When using the Download Dither Matrix command, you have several options: • You can choose whether to define a separate matrix for each color plane, or use the same matrix for all three color planes. • You set the height and width of the dither cell. When using separate matrices for each plane, you can use different size dither cells for each plane.
A downloaded user-defined dither will not take effect until after explicitly selecting it via a render algorithm command with a value of 9 or 10. However, if the current render algorithm (or last render algorithm received) was a user-defined algorithm (value 9 or 10), then a user-defined matrix will take effect as soon as it is downloaded. In this case, another render algorithm command (value 9 or 10) is not needed to “select” the downloaded user-defined dither matrix.
Format This byte should be set to 0. Number of Planes This byte designates how many dither matrices are specified by the command. The command is ignored and the data discarded for any value other than 1 or 3. Byte Value Value Description 1 One matrix applied to all primaries 3 Each primary has a separate matrix Height and Width These bytes designate the size of the dither matrix in pixels.
Each dither matrix must be completely specified. Otherwise, the width and height values may be misinterpreted if multiple matrices are sent. If the width, height, and data specifications result in an odd number data bytes, the next matrix specification will begin on an odd byte boundary. No padding is provided for even-byte aligning. Multiple Dither Matrices As noted in the previous table, you set the number of planes field to 3 to send separate matrices for each primary.
Byte 15 (msb) 8 7 (lsb) 0 Byte 0 Format = 0 Number of planes = 3 1 2 Dither matrix height in pixels (uint 16) 3 4 Dither matrix width in pixels (uint 16) 5 6 byte #0 (ubyte) byte #1 (ubyte) 7 8 byte #2 (ubyte) byte #3 (ubyte) 9 • • n Dither matrix height in pixels (uint 16) n+1 n+2 Dither matrix width in pixels (uint 16) n+3 n+4 byte #0 (ubyte) byte #1 (ubyte) n+5 n+6 byte #2 (ubyte) byte #3 (ubyte) n+7 • • m Dither matrix height in pixels (uint 16) m+1 m+2 Dither ma
The byte-aligned binary data field (shown as ASCII for clarity) would be: Byte 15 (msb) 8 7 (lsb) 0 Byte 0 0 1 1 2 0 4 3 4 0 4 5 6 B0 B1 7 8 B2 B3 9 B15 21 • • 20 B14 Note Do not use downloaded dither matrices as patterns since the orientation of the pattern will not rotate with changes in orientation and page rotation. Note HP Color LaserJet 5 and 5M printers do not support the Download Dither Matrix command.
Color Lookup Tables Color lookup tables provide a way to re-map color data for the following types of applications: • Highlight and shadow modification • Saturation and desaturation • Unique gamma correction curves • Special effects for tonal correction • Neutral balancing Color lookup tables map input data for each primary color into a new output range based on point-by-point conversions. Color lookup tables can modify input data for both device-dependent and device-independent color spaces.
Figure D-1 Color Lookup Tables This command enables the color lookup tables until an ?E, Configure Image Data (CID), or another Color Lookup Tables command with a 0 value field is received. Note RGB gamma correction (?*t#I) and color lookup tables for device-dependent color spaces are mutually exclusive and overwrite each other.
As shown below, the 256 point-by-point transformation curve for each primary color is defined sequentially for a total of 768 bytes, with the additional 2 bytes for specifying the color space and reserved data field. Byte 15 (msb) 87 (lsb) 0 Byte 0 Color Space Reserved Data Field 1 2 Color Component 1, Index 1 Color Component 1, Index 2 3 4 Color Component 1, Index 3 Color Component 1, Index 4 5 ...
Byte 0 (Color Space) Value Color Space 0 Device RGB (default) 1 Device CMY 2 Colorimetric RGB Spaces 3 CIE L*a*b* 4 Luminance-Chrominance Spaces A color lookup table can be attached to one or more of the color spaces anytime after a CID command.
Gamma Correction Color monitors, which are by nature non-linear, appear incorrect when given a linear ramp of some color. Gamma correction can significantly improve perceptual correctness by adjusting the brightness or darkness of the color data sent from the monitor to any other non-linear device. Gamma Correction Command ?*t#I # = Gamma number Default = 0 (gamma correction off) Range = 0.0 to 32767.0 (command is ignored for invalid values)* * The practical range for gamma values is 0.0 to 4.0.
Viewing Illuminant Printed colors undergo a hue shift when viewed under different illuminations (for example, fluorescent, tungsten, or daylight). Colors with spectral characteristics outside the range of an illumination source are not received, changing the appearance of mixed colors. The Viewing Illuminant command (?*i#W) supports communication of standard illuminations to the printer to allow the printer to compensate for different lighting conditions when appearance matching.
The PCL default viewing illuminant is D65 (6500K). Below is a table of viewing illuminants and their chromaticity values. Illuminant x chromaticity y chromaticity Daylight (D65) (6500K) 0.3127 0.3290 Tungsten (3200K) 0.4476 0.4074 Cool White Fluorescent (5630K) 0.3904 0.3914 This command affects only device-independent color.
Monochrome Printing The Monochrome Print Mode command converts each color value to its grayscale equivalent. This improves throughput, costs less to print, and eliminates waste by providing a draft mode. Monochrome Print Mode Command The Monochrome Print Mode command designates whether to print using the current rendering mode or a fast gray-scale equivalent. Pages printed using the gray-scale equivalent do not use any color and therefore print faster and more economically.
Driver Configuration Command This command specifies the Lightness, Saturation, and Scaling Algorithm to be applied to the document, and allows for the selection and downloading of Color Maps.
function_ index 5 Description Argument Range Download Color 1 Map 3 CMY Color Space CIE Lab Color Space See MapID List (14739 bytes) 1 For the original Color LaserJet printer, the color treatment arguments were slightly different: (0 — Process Blue, 1 — Vivid, and 2 — Business Blue). The following paragraphs describe the function_index values and their arguments. Lightness Negative values darken (unlighten) the image, text or graphics color, but do not have any effect on black or white data.
No Adjustment This setting provides linearization only (that is, the user sees the device as a linear device). Process Blue This setting provides the same results as Vivid Graphics (linearization plus user-preferred enhancements) with the addition of mapping process blue, which looks slightly purple, to a blue closer to that of a standard monitor. This setting is not supported by HP Color LaserJet 5 and 5M printers. Vivid Graphics This setting adds color saturation to the resulting image.
Note For screen matching, the long form of the Configure Image Data command is used and the color maps are generated internally dependent upon the monitor calibration data (the Driver Configuration command is not needed). Download Color Map The printer supports the downloading of color adjustment maps dependent upon the halftone requested, the type of color treatment desired (including device-dependent or independent), and the type of media.
Setting Out of Gamut CIELab Match EN Description MapID Cluster-OutOfGamut-DD 17 Disperse-OutOfGamut-DD 18 Scatter-OutOfGamut-DD 19 ErrorDiffusion-OutOfGamut-DD 20 Cluster-TrueMatch-DD 21 Disperse-TrueMatch-DD 22 Scatter-TrueMatch-DD 23 ErrorDiffusion-TrueMatch-DD 24 Modifying Output Color (Color LaserJet, 5, 5M, DeskJet) D-25
Setting Description MapID Device-Independent No Adjustment Process Blue Transparency Vivid Graphics Out of Gamut CIELab Match Cluster-No Adjust-DI 51 Disperse-No Adjust-DI 52 Scatter-No Adjust-DI 53 ErrorDiffusion-No Adjust-DI 54 Cluster-Process Blue-DI 55 Disperse-Process Blue-DI 56 Scatter-Process Blue-DI 57 ErrorDiffusion-Process Blue-DI 58 Cluster-Transparency-DI 59 Disperse-Transparency-DI 60 Scatter-Transparency-DI 61 ErrorDiffusion-Transparency-DI 62 Cluster-VividGrap
Index A adaptive compression block size 6-28, 6-31 compression methods 6-29 control bytes 6-29 cursor position 6-31 data block 6-28 delta row 6-29, 6-31 duplicate row 6-29, 6-30, 6-31 empty row 6-29, 6-30, 6-31 format 6-29 operation hints 6-31 row length 6-31 run-length encoded 6-29, 6-31 seed row 6-31 TIFF 6-29, 6-31 y-offset 6-31 area fill ID command See also pattern ID command 5-29 area fill, user-defined patterns 5-33 assign color index command 3-20, C-21 B base pattern 5-33 black and white references
transfer raster data 6-32 user-defined pattern 5-38 compression adaptive 6-29 adaptive (operation hints) 6-31 byte counts 6-34 delta row 6-20, 6-24, 6-27 raster data 6-15, 6-23 run-length 6-21 TIFF 6-21 TIFF, raster data 6-20 compression method adaptive 6-28 delta row 6-24 run-length encoding 6-21 setting 6-20 TIFF 6-21 unencoded 6-21 Configure Image Data (CID) command 2-5, B-6 examples B-25 long form B-17 short form B-15 continuation, user-defined pattern descriptor 5-39 control bytes, adaptive compression
transparency mode 5-2 user-defined patterns 5-33 grid centered, pixel 5-27 grid intersection, pixel 5-27 H halftone render algorithms 4-2, A-2, D-3 height pixels, user-defined pattern descriptor 5-39 Horizontal Rectangle Size command 5-46 HP-GL/2 graphics 7-1 HP-GL/2 imaging mode 2-2, 2-13, B-3, B-28 HP-GL/2 pixel placement command 7-22 I ICC profiles 1-4 illumination models A-13 image, raster 6-1 indexed color selection A-5 L logical operation command 5-13 logical operations 5-3, 5-9 and transparency in
pixels and pixel encoding 1-7 plane encoding A-6 position, rectangular area 5-49 PP (pixel placement) command 7-20, 7-22 PP command, HP-GL/2 7-22 primitives A-14 print model A-1 command sequence 5-6 current pattern 5-2 destination image 5-1 logical operations and transparency 5-12 pattern 5-1 pattern ID (area fill ID) command 5-29 pattern transparency mode 5-2, 5-8 rectangular area fills 5-45 rectangular areas, pattern ID command 5-29 Select Current Pattern command 5-32 source image 5-1 source transparency
Set Pattern Reference Point command 5-33, 5-43 shaded fill pattern selection 5-29 patterns 5-30 short form CID command B-15 Simple Color command 2-3, B-4 simple color mode 2-1, 2-3, B-2, B-4 source image 5-2 source raster height command 6-13 source raster width command 6-15 source transparency mode 5-2 Source Transparency Mode command 5-7 SP 6-13 sRGB color space 1-4 Start Raster Graphics command 6-17 user-defined patterns 5-33 V Vertical Rectangle Size command decipoints 5-47 PCL Units 5-47 viewing illum
Index-6 EN