Hp Pcl Users Manual 5 Color Technical Reference ENWW

HP PCL/PJL reference (PCL 5 Color) - Technical Reference Manual bpl13212

PCL to the manual 636a0644-f4ac-4714-a45e-151d347c0e8b

2015-02-09

: Hp Hp-Pcl-Users-Manual-549281 hp-pcl-users-manual-549281 hp pdf

Open the PDF directly: View PDF PDF.
Page Count: 286 [warning: Documents this large are best viewed by clicking the View PDF Link!]

PCL 5 Color Technical
Reference Manual
Hewlett-Packard Company
11311 Chinden Boulevard
Boise, Idaho 83714 U.S.A.
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.
Trademarks
Adobe, PostScript, and the
PostScript logo are trademarks
of Adobe Systems Incorporated
which may be registered in
certain jurisdictions. AppleTalk
is a registered trademark of
Apple Computer, Inc. PCL and
Resolution Enhancement are
registered trademarks of
Hewlett-Packard Company. IBM
is a registered trademark of
International Business
Machines Corporation.
iii
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.
Note All commands described in this manual are not necessarily supported
by all printers. See the PCL 5 Comparison Guide for feature support
information for each printer.
This manual is written primarily for users that are already familiar with
PCL 5 printer features. For information on using PCL 5, see the
PCL 5 Printer Language Technical Reference Manual.
iv
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. Color Printing Overview
This chapter explains background information about printing color
documents using PCL 5. Topics include palettes, color selection, pixel
encoding, color modes, and color matching.
Chapter 2. Using Color Modes
Chapter 2 defines the color modes and describes how to use them,
including descriptions of sending color raster data using different pixel
encoding modes and color spaces.
Chapter 3. Using Palettes
This chapter describes the palettes associated with the color modes
and explains how palettes are created, saved, and modified.
Chapter 4. Modifying Output Color
This chapter explains the options for modifying the output color: the
Render Algorithm command, the Monochrome Print Mode command,
Driver Configuration command, and Finish Mode command.
Chapter 5. The PCL Print Model
Chapter 5 describes the print model and how it determines the
printed outcome when various patterns, colors, and images are
applied together on a page. This chapter discusses the role that
logical operations and transparency modes have on this process.
Chapter 6. Raster Graphics
This chapter describes the raster graphics commands and also
compressing raster graphics images using various compression
methods.
v
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. device-independent color, color selection, pixel encoding, color
modes, and color matching.
Appendix B. Using Color Modes (Color LaserJet, 5,
5M, DeskJet)
Appendix B defines the color modes for the HP Color LaserJet, Color
LaserJet 5, 5M, and the DeskJet 1200C and 1600C printers, and
describes how to use them. It includes descriptions of sending color
raster data using different pixel encoding modes and color spaces.
Appendix C. Using Palettes (Color LaserJet, 5, 5M,
DeskJet)
Appendix C describes the use of palettes for the HP Color LaserJet,
5, and 5M, and DeskJet 1200C and 1600C printers. It explains the
palettes associated with the color modes and explains how palettes
are created, saved, and modified.
Appendix D. Modifying Output Color (Color LaserJet,
5, 5M, DeskJet)
Appendix D describes how to modify output color for the HP Color
LaserJet, Color LaserJet 5, 5M, and the DeskJet 1200C and 1600C
printers. This chapter explains how color can be optimized by
compensating for different conditions, such as variations in color due
to light sources, limitations of the original artwork and variations in
viewing monitors. The chapter details the use of halftone rendering
algorithms, color lookup tables, gamma correction, and viewing
illuminant commands. These commands are provided so that users
can request and receive color output that matches their expectations.
Index
An index offers quick access to PCL command information.
vi
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. A large portion of the manual is devoted to
HP-GL/2, the vector-based graphics language in PCL 5 printers.
PCL 5 Comparison Guide
This document provides printer-specific information on paper
handling, internal fonts, PCL command support, and control panel
information. It identifies feature differences between the various
PCL 5 printers, and how the printers implement the commands
described in the PCL 5 Printer Language Technical Reference
Manual.
Printer Job Language Technical Reference Manual
This manual describes PJL, the HP printer job language used on
many of the Hewlett-Packard printers. PJL is used for switching
printer languages, requesting status information, changing display
messages, inquiring about feature settings, and other job-level
functions.
PCL/PJL Technical Quick Reference Guide
This booklet is designed to provide quick access to the syntax of each
PCL and PJL command. The commands are grouped by their
function so that those familiar with PCL and/or PJL can find the
syntax of a specific command without opening the manual.
EN Contents vii
Contents
PCL 5 Color Technical Reference Manual
Inside This Manual . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . iii
Manual Organization . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . iv
Related Documents. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . vi
Chapter 1 Color Printing Overview
Introduction . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .1-1
Working with color documents . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .1-2
PCL 5 Color Concepts. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .1-3
Color . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .1-3
Color Specifications and Color Spaces . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .1-3
Color Management and the Standard Red, Green, Blue Color Space . . . . . . . .1-4
Palettes and Color Selection. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .1-6
PCL 5 Color Graphics Context . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .1-6
PCL 5 Color Mode . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .1-6
PCL 5 Raster Images . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .1-7
Pixels and Pixel Encoding. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .1-7
Well-Behaved Raster . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .1-9
Chapter 2 Using Color Modes
Introduction . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .2-1
Simple Color Mode . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .2-3
PCL Imaging Mode . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .2-5
Configure Image Data (CID) Command . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .2-5
HP-GL/2 Imaging Mode. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .2-13
Chapter 3 Using Palettes
Introduction . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .3-1
Saving the Palette . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .3-3
Push/Pop Palette Command. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .3-3
Palette Management by ID . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .3-5
Select Palette Command . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .3-6
Palette Control ID . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .3-8
Palette Control. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .3-9
Simple Color Palettes . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .3-11
. . .
. . .
. . .
Contents viii EN
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 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .3-17
Foreground Color Command . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .3-17
Programming Color Palettes . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .3-19
Chapter 4 Modifying Output Color
Introduction . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .4-1
Halftone Render Algorithms . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .4-2
Render Algorithm Command . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .4-2
Monochrome Printing . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .4-3
Monochrome Print Mode Command. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .4-3
Driver Configuration Command. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .4-4
Finish Mode Command . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .4-6
Chapter 5 The PCL Print Model
Introduction . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .5-1
Command Sequence. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .5-6
Source Transparency Mode Command. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .5-7
Pattern Transparency Mode Command. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .5-8
Logical Operations . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .5-9
Logical Operations and Transparency Interactions. . . . . . . . . . . . . . . . . . . . . .5-12
Logical Operation Command. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .5-13
ROPs in the RGB Color Space. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .5-14
ROPs in the CMY Color Space. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .5-15
Using a ROP. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .5-16
Table of Logical Operations . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .5-18
Pixel Placement. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .5-24
Pixel Placement Command . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .5-27
Filling with Patterns . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .5-28
Pattern ID (Area Fill ID) Command . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .5-29
Select Current Pattern Command . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .5-32
User-Defined Pattern Graphics . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .5-33
Using User-Defined Patterns . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .5-33
How the Printer Tiles a Pattern. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .5-34
Pattern Reference Point . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .5-36
Download Pattern Command . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .5-38
User-defined Pattern Example . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .5-40
Set Pattern Reference Point Command . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .5-43
Pattern Control Command. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .5-44
Rectangular Area Fills (Rules) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .5-45
Pattern Transparency for Rectangular Area Fill. . . . . . . . . . . . . . . . . . . . . . . . . . . .5-50
EN Contents ix
Rectangular Fill Examples. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .5-52
Solid Fill (Black/White) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .5-52
Shaded Fill . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .5-54
Chapter 6 Raster Graphics
Introduction . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .6-1
PCL 5 Color Raster Graphics . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .6-4
Raster Graphics Command Sequence . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .6-6
Raster Graphics Resolution Command. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .6-8
Raster Graphics Presentation Mode Command . . . . . . . . . . . . . . . . . . . . . . . . . . .6-10
Source Raster Height Command . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .6-13
Source Raster Width Command . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .6-15
Start Raster Graphics Command . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .6-17
Raster Y Offset Command . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .6-19
Set Compression Method Command . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .6-20
Unencoded (Method 0). . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .6-21
Run-length Encoding (Method 1) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .6-21
Tagged Image File Format Encoding (Method 2) . . . . . . . . . . . . . . . . . . . . . . .6-21
Delta Row Compression (Method 3). . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .6-24
Adaptive Compression (Method 5) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .6-28
Transfer Raster Data Commands . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .6-32
Transfer Raster Data by Plane . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .6-33
Transfer Raster Data By Row/Block Command . . . . . . . . . . . . . . . . . . . . . . . .6-33
End Raster Graphics Command . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .6-35
Raster Scaling. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .6-36
Raster Graphics Example . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .6-38
Color Raster Graphics Example . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .6-42
Chapter 7 Color Vector Graphics (HP-GL/2)
Introduction . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .7-1
Enter HP-GL/2 Mode. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .7-2
MC (Merge Control). . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .7-6
PC (Pen Color) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .7-14
NP (Number of Pens) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .7-17
CR (Color Range) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .7-19
PP (Pixel Placement) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .7-20
Contents x EN
Appendix A Color Printing Overview (Color LaserJet, 5, 5M,
DeskJet)
Introduction . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . A-1
Color Concepts . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . A-3
Palettes. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . A-3
Raster Mode . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . A-3
Raster Color vs. Non-Raster Color . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . A-3
Device-Dependent vs. Device-Independent Color . . . . . . . . . . . . . . . . . . . . . . A-4
Black and White References. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . A-4
Color Selection . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . A-5
Pixel Encoding . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . A-6
Encoding by Plane . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . A-6
Color Modes . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . A-7
Device-Dependent Color Spaces . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . A-8
Device-Independent Color Spaces . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . A-8
Device-Independent Color. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . A-10
Device-Dependent Color. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . A-10
Device-Independent Color . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . A-10
Color Matching . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . A-11
Processing Color Documents . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . A-14
Non-Raster Color vs. Raster Color . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . A-14
Color Raster Data . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . A-14
Appendix B Using Color Modes (Color LaserJet, 5, 5M, DeskJet)
Introduction . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . B-2
Simple Color Mode . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . B-4
PCL Imaging Mode . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . B-6
Configure Image Data (CID) Command . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . B-6
Short Form of CID Command (Configure Image Data) . . . . . . . . . . . . . . . . . B-15
Long Form of CID Command (Configure Image Data) . . . . . . . . . . . . . . . . . . B-17
HP-GL/2 Imaging Mode. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . B-28
Appendix C Using Palettes (Color LaserJet, 5, 5M, DeskJet)
Introduction . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . C-1
Saving the Palette . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . C-3
Push/Pop Palette Command. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . C-3
Palette Management by ID . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . C-5
Palette Control ID . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . C-8
Palette Control. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . C-9
Simple Color Palettes . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . C-11
CID Color Palettes. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . C-13
HP-GL/2 Palettes . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . C-16
Foreground Color . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . C-18
EN Contents xi
Programming Color Palettes . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . C-20
Color Component One . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . C-20
Color Component Two . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . C-20
Color Component Three . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . C-21
Assign Color Index . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . C-21
Appendix D Modifying Output Color (Color LaserJet, 5, 5M,
DeskJet)
Introduction . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . D-1
Halftone Render Algorithms . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . D-3
Render Algorithm Command . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . D-3
User-Defined Dithers . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . D-6
Download Dither Matrix Command. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . D-7
Multiple Dither Matrices . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . D-10
Color Lookup Tables . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . D-13
Gamma Correction . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . D-17
Viewing Illuminant . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . D-18
Monochrome Printing . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . D-20
Driver Configuration Command. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . D-21
Index
Contents xii EN
EN Color Printing Overview 1-1
1Color 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. However, this goal has
been very difficult to realize due to a number of factors such as:
Some colors that can be shown on a computer display cannot
be reproduced by a printer.
The Cyan, Magenta, and Yellow colors used to create the
colors specified in a document can differ in hue and quality
from printer to printer, even printers from the same
manufacturer. Furthermore, the colors produced by a given
printer can change over time, due to internal changes as well
as temperature and humidity.
Until recently, these and other problems have led HP to approach
color matching by presenting a PCL 5 color command set giving
users the ability to make both major and minor color print quality
adjustments.
However, the emergence of sRGB (standard Red Green Blue) as an
international color data standard and the growing sophistication of
Hewlett-Packard printers has allowed HP to provide high quality
WYSIWYG color documents with a much simpler PCL color
command set. Therefore, this manual has two main parts: Chapters 1
through 7 present the latest, simplified PCL 5 color command set, and
the appendices describe the command set described in Chapters 1
through 4 as they are supported by the Color LaserJet, Color
LaserJet 5, DeskJet 1200C, and DeskJet 1600C printers.
Chapters 5 – 7 pertain to both sets of printers.
1-2 Color Printing Overview EN
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. For vector
graphics and text, the PCL 5 color commands support the application
of a color from a palette of colors.
Each color printed is synthesized from a combination of three colors:
Cyan, Magenta, and Yellow. The way the three colors are combined to
produce the desired color is called a half-tone, and the PCL 5 color
command, Render Algorithm, specifies which half-tone to use for a
color. Advances in Hewlett-Packard printers have allowed HP to
reduce the number of render algorithms to Best, High, and Low. While
the actual implementation of each of these algorithms may vary from
printer to printer, HP has determined that the three algorithms are
sufficient to produce high quality color documents containing text and
graphics.
The colors that appear on a page also have one of two color
treatments applied to them:
1Screen Match (sRGB), which provides the best WYSIWYG color.
This is the default color treatment.
2The Vivid color treatment, which provides access to the entire
device gamut (range of colors the printer can produce). However,
these colors are less correlated to those shown on a monitor than
colors that have had the Screen Match treatment applied.
The following factors form the heart of the PCL color graphics state:
The palette of colors to be used in a document
The render algorithm to print the colors
The color treatment to be applied to each color
Palettes of colors can be referenced by an ID, and so can PCL color
graphic states. At any given time there is an active palette to apply
colors from, along with a render algorithm and color treatment to be
applied to the colors. Palettes and their associated render algorithm
and color treatment can be stored and retrieved using a palette ID.
When a palette is retrieved and made the active palette, the render
algorithm and color treatment stored with the palette are set as the
current render algorithm and color treatment.
EN Color Printing Overview 1-3
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
Color is a combination of human physiological and psychological
responses to a relatively narrow band of frequencies in the
electromagnetic spectrum. The frequencies visible to the human eye
are called the visible spectrum. It’s useful to understand that color
comes both from direct light and indirect light that has reflected from a
surface. Reflected light absorbs all but the reflected frequency. The
colors seen on a color monitor are combinations of different-colored
lights traveling directly to the eye. They are called additive colors
since the different colors combine to form the resulting color. The
colors seen on a printed material such as paper are reflected from the
paper surface, which absorbs some of the light. Colors seen under
these conditions depend on the viewing conditions, the amount and
color of ambient light, as well as the amount and color of the reflected
light.
Color Specifications and Color Spaces
A given color can be described as particular amounts of three light
frequencies (red, green, and blue light). For example, equal amounts
of red, green, and blue light are perceived as white light. The absence
of all three primary light colors is black.
1-4 Color Printing Overview EN
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. The CMYK color space is similar to the CMY color
space, but black pigment is used in place of 100% C, M, Y since
imperfections in the hues of the C, M, Y pigments yield a dark brown
rather than black.
A color specification, then, depends on the color space as well as the
values used to describe a given color. Black in the RGB color space is
described using the three numbers (0, 0, 0), but in the CMY color
space it is described as (100, 100, 100), where the values are
percentages of each color.
Color Management and the Standard Red,
Green, Blue Color Space
For color to be reproduced in a predictable manner across different
devices and materials, it has to be described in a way that is
independent of the specific mechanisms and materials used to
produce it. For instance, color displays and color printers use very
different mechanisms for producing color. Traditionally, operating
systems have supported color by declaring support for a particular
color space (RGB in most cases). However, since the interpretation of
RGB values varies between devices, color was not reliably
reproduced across different devices.
The needs of the very high-end publishing sector could not be met by
the traditional means of color support, so the various computer
operating systems added support for using International Color
Consortium (ICC) profiles to characterize device-dependent colors in
a device-independent way. They used the profiles of the input device
that created an image, and the output device that displayed or printed
the image, to create a transform that moved the image from the color
space of the input device to that of the output device. This resulted in
very accurate color and access to the entire color gamut of both
devices. However, it also involved the overhead of transporting the
profile of the input device with the image and running the image
through the transform.
EN Color Printing Overview 1-5
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.
However, there are a broad range of users that do not require this
level of flexibility and control in an embedded color profile
mechanism. Instead it is possible to define a single, standard default
color space for exchange and interpretation of color data. Additionally,
most existing file formats do not support color profile embedding, and
may never do so. There is also a broad range of uses that actually
discourages people from appending any extra data to their files. The
sRGB color space addresses these issues.
The sRGB color space maintains the advantage of a clear
relationship with ICC color management systems while minimizing
software processes and support requirements. Since the image is in
a known color space and the profile for that color space is included
within the operating system and display application, this enables
end-users to enjoy the benefits of color management without the
overhead of larger files. Application developers and users who do not
want the overhead of embedding profiles in documents or images
should convert them to sRGB. While it may be that profiles buy
slightly higher color accuracy, the benefits of using a standard color
space far outweigh the drawbacks for a wide range of users. The
migration of devices to support the standard color space (sRGB)
natively will further enhance the speed and quality of the user
experience.
The international standard color space sRGB (IEC 61966-2-1) is
designed to complement current color management strategies by
enabling a simple, robust method of handling color in the operating
systems, device drivers and the Internet. This solution provides good
quality and backward compatibility with minimum transmission and
system overhead. Based on a calibrated colorimetric RGB color
space well suited to cathode ray tube (CRT) displays, flat panel
displays, television, scanners, digital cameras, and printing systems,
the sRGB color space can be supported with minimum cost to
software and hardware vendors. The four major technical
components of the sRGB color space are the standard CRT primaries
(HDTV P22 phosphors); the simple gamma value of 2.2, a D65 white
point, and its well-defined viewing conditions.
1-6 Color Printing Overview EN
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.
The largest palette holds 256 colors, which is approximately the
largest set of distinct colors the human eye can distinguish under
normal viewing conditions.
A color from a palette can be applied to either text or vector graphics
using the Foreground Color command. Once the command is invoked
the selected color will be applied to all text and vector graphics page
marking primitives, and to a certain extent to raster images.
Palettes can be identified with a Palette ID and then stored and
recalled as needed. A palette stack mechanism is also supported for
the convenience of applications that work well with a graphics stack.
PCL 5 Color Graphics Context
The Palette acts as the focal point of the PCL 5 color graphics
context. The color space, render algorithm, color treatment, and pixel
encoding mode are stored along with the palette. Therefore, selecting
or restoring a palette also restores these values.
PCL 5 Color Mode
The PCL language has four modes or ways of specifying and using
color:
Black-and-White (monochrome) mode is the default mode so
that backward compatibility with previous printers is
maintained. When the printer is turned on it has a 2-entry
palette containing the color white at index 0 and black at
index 1. When the printer is reset with an ?E it reverts to this
mode.
Simple Color mode is entered with the Simple Color
command, which creates one of three fixed color palettes:
zA monochrome, two-entry palette with white at index 0 and
black at index 1.
EN Color Printing Overview 1-7
zAn RGB, eight-entry palette with the following colors
starting at index 0: black, red, green, yellow, blue,
magenta, cyan, and white.
zA 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.
HP-GL/2 Imaging mode is entered when HP GL/2 mode is
entered and the initialize command IN creates a
programmable palette that is shared between PCL and
HP-GL/2.
Any and all of the modes can be used on a page. For example, you
could enter the Simple Color mode to print a headline and bar chart,
PCL imaging mode to print a photographic image, and
Black-and-White mode for the text on the page. Each mode is
described in more detail in Chapter 2. “Using Color Modes.
PCL 5 Raster Images
Monochrome PCL 5 raster images are made up of a series of zeros
and ones. A one indicates that a black dot should be deposited, a
zero indicates no dot, letting the white background show through. A
one-inch wide image with a resolution of 600 dots per inch (DPI) has
600 consecutive zeros and/or ones, which represent a horizontal slice
through the image starting at the left edge of the image. This slice is
known as a raster row. For an image one inch high and one inch wide,
at 600 dpi there are 600 hundred rows of 600 zeros and/or ones.
Color raster images follow the same conventions with this major
exception: the representation of a dot is changed from a single zero
or one to a color specification (a pixel).
Pixels and Pixel Encoding
Raster images can be thought of as being composed of a series of
pixels (picture elements). In the case of monochrome raster images,
a pixel is a single bit which takes on a value of zero or one. In color
images a pixel is essentially a color specification. However, there are
several ways of specifying a color, and how the color is specified is
called the Pixel Encoding Mode (PEM).
1-8 Color Printing Overview EN
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:
1Indexed by Plane
2Indexed by Pixel
3Direct by Plane
4Direct by Pixel (also known as 24-bit direct).
For example, the format known as direct by plane, uses a 3-bit pixel
where the first bit indicates the presence or absence of a red dot, the
second a green dot and the third a blue dot. The data is still arranged
in rows, but all the red data is sent, then the green and finally all the
blue. The example below represents the commands to transfer an
image with the direct by plane PEM. The underlined bits, while
transferred separately, are logically from the same pixel.
The direct by pixel PEM uses only the row transfer command. Each
pixel is composed of three bytes, one byte per component of the color
specification. All the bytes of a given pixel are transferred before the
next one is transferred.
The indexed by pixel PEM is similar to the direct pixel PEM but the
pixel occupies at most one byte and is an index into the current
palette.
The indexed by plane PEM is similar to the direct by plane PEM
except the pixel's value is an index into the current palette. The use of
this mode is discouraged due to the extra processing required to
combine the bits from each plane into a single number, which is then
used as an index into the current palette.
?*b#V row 1 plane 1 (red) b1 b1 b1 b1 b1 b1...
?*b#V plane 2 (green) b2 b2 b2 b2 b2 b2...
?*b#W plane 3 (blue) b3 b3 b3 b3 b3 b3...
?*b#V row 2 plane 1 (red) b1 b1 b1 b1 b1 b1...
?*b#W row x b1 b2 b3 b1 b2 b3 b1...
EN Color Printing Overview 1-9
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. These can
occur when “nearest neighbor operations” are applied to pixels that
appear to be at the edge of an image, but are really inside an image
that has been artificially broken up into smaller images.
1-10 Color Printing Overview EN
EN Using Color Modes 2-1
2Using 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 devices power
up in this mode and revert back to it whenever the printer receives an
?E reset. Black-and-White mode is also selectable using the Simple
Color command (?*r1U). This mode creates an unmodifiable, default
2-pen palette, with white at index 0 and black at index 1 (compatible
with existing monochrome PCL 5 printers).
Simple Color Mode
Simple Color Mode, entered by the Simple Color command (?*r#U),
creates a fixed-size, fixed-color, unmodifiable palette. Depending on
the value field, ?*r#U can create a 2-pen Black-and-White palette,
an 8-pen RGB palette, or an 8-pen CMY palette. When using the
Simple Color mode, the pixel encoding mode is always indexed
planar.
2-2 Using Color Modes EN
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.
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 Chapter 3, “Using Palettes,” for more
information).
Although default HP-GL/2 palettes are different than default PCL
palettes, an HP-GL/2 palette is modifiable in either PCL or HP-GL/2
(using the Assign Color Index [?*v#I] or Pen Color [PC] commands,
respectively). Likewise, a PCL palette created by the Configure Image
Data command (?*v#W) is modifiable in both PCL and HP-GL/2
using the same commands.
The active palette is always transferred between HP-GL/2 and PCL
contexts. Since only one palette at a time can be active, a new palette
created in either context overwrites the current palette.
EN Using Color Modes 2-3
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.
?*r#U
This command destroys the active palette and creates a new palette,
which becomes the active palette. When the Simple Color mode is
active, PCL and HP-GL/2 commands that modify the palette are
locked out (NP, PC, ?*v#A, ?*v#B, ?*v#C, ?*v#I). When a Simple
Color palette is popped from the stack (?*p#P), it cannot be
modified, and the pixel encoding mode reverts to indexed planar.
A value field of 1 creates a 2-entry Black-and-White default
palette.
A value field of 3 creates an 8-entry Device RGB palette
(compatible with a PCL Imaging Mode palette, but not an
HP-GL/2 default (IN) palette).
A value field of –3 creates an 8-entry palette in Device CMY
color space.
# = –3 - 3 planes, device CMY palette
1 - Single plane K (Black) palette
3 - 3 planes, device RGB palette
Default =1
Range =–3, 1, 3
2-4 Using Color Modes EN
The Simple Color palettes are structured as follows:
Single Plane (value = 1)
3-Plane RGB (value = 3)
3-Plane CMY (value = –3)
Index Color
0White
1Black
Index Color
0Black
1Red
2Green
3Yellow
4Blue
5 Magenta
6Cyan
7White
Index Color
0White
1Cyan
2 Magenta
3Blue
4Yellow
5Green
6Red
7Black
EN Using Color Modes 2-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 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 CID command performs the
following:
Designates the color space for the newly created palette
Designates the size of the palette
Designates the Pixel Encoding Mode, the format of the raster
data
Designates, in certain circumstances, the size, in bits, of the
three components of the color specifications. However, this
information is rarely useful since it applies only to the
direct-by-pixel PEM, where the format must be eight bits per
component for 24-bit direct color, and the direct-by-plane,
where there is one bit per component.
?*v6W b0 b1 b2 b3 b4 b5
Where:
6 = The number of bytes following the “W”
b0 = byte 0 The color space
b1 = byte 1 The Pixel Encoding Mode
b2 = byte 2 The number of bits per index which implies the
size of the palette
b3 = byte 3 The number of bits in color component
(primary) #1
b4 = byte 4 The number of bits in color component
(primary) #2
b5 = byte 5 The number of bits in color component
(primary) #3
2-6 Using Color Modes EN
The bytes are ordered as follows and are unsigned bytes:
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 0 (Color Space)
This byte specifies the color space. The range of values is 0 through
2. All other values are ignored.
Color space 2, sRGB, was the designation for Colorimetric RGB in
the Color LaserJet and Color LaserJet 5 printers. The value 2 is used
to represent sRGB since it is analogous to a standardized
Colorimetric RGB and the intent of the two color spaces is the same.
Byte 15 (MSB) 8 7 0 (LSB) Byte
0Color space Pixel encoding mode 1
2Bits/index Bits/primary #1 3
4Bits/primary #2 Bits/primary #3 5
Byte Value Color Space
0 Device Dependent RGB (default)
1 Device Dependent CMY
2 Standard RGB (sRGB)
EN Using Color Modes 2-7
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.
The number of bits per index determines the size of the palette
created by this command. In the case of the Indexed by Plane mode
the number of planes needed to represent the index is also
determined by the number of bits per index. Therefore, if a 256 entry
palette is needed, then the bits per index is set to eight since
28= 256. If the Indexed by Plane mode is chosen, at most eight
planes are needed to represent each row of data.
The recommended pixel encoding mode is Direct by Pixel, since this
gives the most efficient raster processing. However, using this mode
means that delta row compression should be used since it exploits
redundancy between rows. Other PCL compression modes exploit
redundancy within a row. With Direct by Pixel the redundancy from
pixel to pixel in a row is masked by the differences at the byte level
within the pixel, that is, the differences between the red, green, and
blue bytes within the pixel.
Note Raster data in Index by Plane or Direct by Plane modes cannot be
compressed using raster compression mode 5.
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
8bits/pixel (2
8 = 256).
Value Pixel Encoding
Mode Restrictions
0Indexed by Plane Bits/Index can only be 1, 2, 3, 4, 5, 6,
7, or 8. Bit/Components 1, 2, and 3
are ignored
1Indexed by Pixel Bits/Index can only be 1, 2, 4, or 8.
Bit/Components 1, 2, and 3 are
ignored
2Direct by Plane Bits/Components 1, 2, and 3 must
be 1
3Direct by Pixel Bits/Components 1, 2, and 3 must
be 8
2-8 Using Color Modes EN
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. For
example, assuming three bits per index, the underlined column of bits
in the figure below is the palette index for pixel three of the first row (i1
is the least significant bit, i3 is the most significant bit). Note that the
Transfer Raster Data by Plane command (?*b#V) is used for all
planes except the last plane of each row, which is sent using the
Transfer Raster Data by Row command (?*b#W).
Example:
In the example below, the row transfer commands are shown in
binary for clarity, even though the actual data would be byte-aligned
binary data. The example is for an eight-pixel-wide image.
?*b#V row 1 plane 1 i1 i1 i1 i1 i1 i1
?*b#V plane 2 i2 i2 i2 i2 i2 i2
?*b#W plane 3 i3 i3 i3 i3 i3 i3
?*b#V row 2 plane 1 i1 i1 i1 i1 i1 i1
?*v6W 00 00 03 08 08 08 Binary data for CID represented
in hex. This command sets the
color space to RGB, the PEM to
Indexed by Plane, the palette size
to 8 (23). The last 3 bytes are
ignored.
?*r1A Start raster.
?*b1V10110000 Transfer plane 1 (the first bit for
each pixel in the first row).
?*b1V01110000 Transfer plane 2 (the second bit
for each pixel in the row).
?*b1W10101000 Transfer plane 3 (the third and
final bit for each pixel in the row)
and move to the next row. Note
that the ?*b#W command is
used to send the last plane of
each row.
EN Using Color Modes 2-9
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 . . .
Example:
In the example below the data in the row transfer commands are
shown as two-digit hexadecimal numbers for clarity, even though the
actual data would be byte-aligned binary data. The example is for a
two-pixel-wide image.
?*v6W 00 01 04 08 08 08 Binary Data for the CID
command represented in
hexadecimal. This command
sets the color space to RGB, the
PEM to Indexed by Pixel, the
palette size to 16 (24). The last
three bytes are ignored.
?*r1A Start raster
?*b1W45 The most significant nibble
selects palette entry 4 for the
first pixel. The second pixel is set
to index 5. Move to next row.
?*b1W6A The first pixel is index 6, the
second pixel is index 10. Move to
the next row.
?*b1W03 The first pixel is index 0, the
second pixel is index 3.
2-10 Using Color Modes EN
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.
Example:
In the example below the data in the row transfer commands are
shown in binary for clarity, even though the actual data would be
byte-aligned binary data. The example is for an eight-pixel-wide
image.
?*b#V row 1 plane 1 (red) b1 b1 b1 b1 b1 b1
?*b#V plane 2 (green) b2 b2 b2 b2 b2 b2
?*b#W plane 3 (blue) b3 b3 b3 b3 b3 b3
?*b#V row 2 plane 1 (red) b1 b1 b1 b1 b1 b1
?*v6W 00 02 01 01 01 01 Binary Data for the CID command
represented in hexadecimal. This
command sets the color space to
RGB, the PEM to Direct by Plane.
The palette size is ignored. The
last three bytes are always one
for this mode.
?*r1A Start raster
?*b1V10110000 Transfer plane 1 (the first bit for
each pixel in the first row). Each
bit controls the red primary.
?*b1V01110000 Transfer plane 2 (the second bit
for each pixel in the row). Each bit
controls the green primary.
?*b1W10101000 Transfer plane 3 (the third and
final bit for each pixel in the row)
and move to the next row. Each
bit controls the blue primary. Note
that the ?*b#W command is
used to send the last plane of
each row.
EN Using Color Modes 2-11
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.
Example:
In the example below the data in the row transfer commands are
shown as two-digit hexadecimal numbers for clarity, even though the
actual data would be byte-aligned binary data. The example is for a
one-pixel-wide image.
Byte 2 (Number of Bits per Index)
This command creates a palette regardless of the PEM chosen. This
byte determines the size of the created palette. The palette size is two
raised to the power of n (2n), where n is the bits per index.
In the Indexed-by-Plane PEM, where the raster data is
interpreted as palette indices, this value determines the
number of planes required per row.
?*b#W row 1 r7–r0 g7–g0 b7–b0 . . .
?*b#W row 2 r7–r0 g7–g0 b7–b0 . . .
?*b#W row 3 r7–r0 g7–g0 b7–b0 . . .
?*v6W 00 03 00 08 08 08 Binary Data for CID command
represented in hexadecimal.
This command sets the color
space to RGB, the PEM to
Direct by Pixel. The palette size
is ignored. The last three bytes
must be 8.
?*r1A Start raster
?*b3W 45 06 30 The three bytes specify a single
pixel. The first sets 45 as the red
component’s value, the second
sets the green value to 06, and
the third sets the blue value to
30.
2-12 Using Color Modes EN
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:
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. For the Direct by Plane PEM they must be set to one bit per
component. For the Direct by Pixel PEM, they must be set to eight bits
per component.
Bits/Index Indices/Byte
18
24
42
81
EN Using Color Modes 2-13
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.
Compared to monochrome printers, the HP Color LaserJet printer
family, DeskJet 1200C and 1600C color printers have some
commands that are new and/or modified for use with color printers.
Chapter 7 describes the new or modified HP-GL/2 commands.
If you are not familiar with using HP-GL/2, see the PCL 5 Printer
Language Technical Reference Manual. It provides a detailed
explanation of using HP-GL/2.
2-14 Using Color Modes EN
EN Using Palettes 3-1
3Using 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.
3-2 Using Palettes EN
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. When switching between PCL 5 and HP-GL/2 contexts, the
active palette is automatically transferred.
Multiple palettes can exist in the system via the Palette ID and Palette
Stack mechanism. However, only one palette at a time can be active.
A palette created in the PCL context remains active and unchanged
when switching to the HP-GL/2 context, and a palette created in the
HP-GL/2 context remains active and unchanged when switching to
the PCL context. Performing a reset or entering PJL overwrites the
active palette with the default black and white palette.
Whenever a new palette is created, the currently or previously active
palette is destroyed. A new palette is created by power-on and also by
the following commands:
PCL Reset (?E)
•Simple Color (
?*r#U)
Configure Image Data (?*v#W)
HP-GL/2 Initialize (IN)
The active palette can be saved by pushing it onto the palette stack
with the Push/Pop Palette command (?*p#P). Popping a palette from
the stack destroys the active palette—the popped palette becomes
the active palette.
EN Using Palettes 3-3
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
A value of 0 (?*p0P) pushes a copy of the active palette onto the
palette stack. When a palette is pushed, the active palette is not
affected.
A value of 1 (?*p1P) pops the most recently pushed palette and
destroys the active palette; the popped palette becomes the active
palette. As with any stack, the last item pushed is the first item
popped.
Pushing a palette saves the following parameters:
Color definitions for each palette entry
Pen widths (for HP-GL/2 use)
Color space specification
Number of bits per index
Pixel encoding mode
Number of bits per primary
Color treatment
Render algorithm
# = 0 - Push (save) palette
1 - Pop (restore) palette
Default =0
Range = 0, 1 (invalid values are ignored)
3-4 Using Palettes EN
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. A palette that was popped in an
executed macro remains in effect at the end of the macro (this is not
true for “called” or “overlaid” macros).
The PCL reset command (?E) or an exit to PJL causes the printer to
empty the palette stack and overwrite the active palette with a
non-programmable black and white palette. The HP-GL/2 commands
IN and DF have no effect on the palette stack, but they do destroy the
active palette and replace it with the default HP-GL/2 palette.
EN Using Palettes 3-5
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.
Palettes on the stack may not be selected by ID, since only a copy of
a palette is pushed onto the stack; the original palette and ID remain
in the palette store. A palette popped from the stack goes into the
palette store, becomes the new active palette, and assumes the ID of
the previously active palette, which is overwritten. Only one palette at
a time may be active.
3-6 Using Palettes EN
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.
Besides the color entries, a palette also has the graphics state which
contains the color space, color treatment, and render algorithm. This
ensures that the same color specification in a given palette will always
produce the same printed color.
As described below, the Select Palette (?&p#S), Palette Control
(?&p#C), and Palette Control ID (?&p#I) commands implement the
three basic operations of management by ID.
Selection of the active palette
Deletion of palettes
Copying of palettes
Select Palette Command
The Select Palette command selects a new active palette by
specifying an ID number. The previously active palette is unchanged.
?&p#S
This command activates the designated palette in the palette store.
The command is ignored if the specified ID matches the active
palette's ID, or if no palette with that ID exists. The designated ID is
saved as the palette select ID for the duration of the print job, or until
another Select Palette command is received.
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.
#= Palette ID number
Default =0
Range = 0 to 32767 (command is ignored for out- of-range
values)
EN Using Palettes 3-7
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.
?E resets the palette select ID value to 0 and deletes all palettes in
the palette stack and palette store, including the active palette, which
is replaced by a default PCL fixed black and white palette with a
palette ID of 0.
Macros affect the palette select ID value as follows:
Calling or Overlaying a macro—saves the ID value and a copy
of the active palette. Upon macro exit, the restored palette
again becomes the active palette with the restored ID. An
existing palette with this ID is deleted.
Executing a macro—does not save the ID value or the active
palette; changes remain in effect.
3-8 Using Palettes EN
Palette Control ID
The Palette Control ID command specifies the ID number to be used
by the Palette Control Command.
?&p#I
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.
Macros affect the palette control ID value as follows:
Calling a macro—saves the value and restores the value at
exit.
Executing a macro—does not save the value; changes remain
in effect at exit.
Overlaying a macro—copies the value before resetting to 0,
and restores at exit.
# = Palette ID number
Default =0
Range = 0 to 32767 (command is ignored for out-of-range
values)
EN Using Palettes 3-9
Palette Control
The Palette Control command provides a mechanism for making and
deleting palettes.
?&p#C
A value of 0 deletes all palettes except those on the palette
stack. The active palette is replaced by the default black and
white palette (ID 0). The palette control ID is not used.
A value of 1 clears the palette stack. The active palette is
unaffected, and the palette control ID is not used.
A value of 2 deletes the palette with the specified palette
control ID if it exists; otherwise the command is ignored. For
example, to delete palette 53, send ?&p53i2C. If the active
palette's ID is specified the active palette is replaced by the
default black and white palette. This option does not change
the palette control ID value.
Note When the active palette is replaced by the default black and white
palette, the graphics state associated with the previous palette is also
replaced.
A value of 6 creates a copy of the active palette. The copy
receives the ID specified by the last Palette Control ID
command. For example, to copy the active palette to a palette
with an ID of 14, send ?&p14i6C. The copied palette
overwrites any palette that already has an ID equal to the
palette control ID. The copied palette does not become the
active palette. The command is ignored if a palette is to be
copied to its own ID.
# = 0 - Delete all palettes except those in the stack (active
palette deleted)
1 - Delete all palettes in the stack (active palette is not
affected)
2 - Delete palette (specified by Palette Control ID)
6 - Copy active palette to ID specified by Palette Control ID
Default =0
Range = 0, 1, 2, 6 (command is ignored for unsupported values)
3-10 Using Palettes EN
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. The
adverse effect could be the deletion of the desired palette, and
replacement with a black and white non-programmable palette.
EN Using Palettes 3-11
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”. Only the IN or the CID (?*v#W)
commands can create a modifiable palette.
As shown below, a value field of 1 (?*r1U) creates a black and white
palette. A value of 3 creates an 8-pen palette in Device RGB color
space. A value of –3 creates an 8-pen palette in Device CMY color
space. All of these Simple Color palettes are fixed and
non-programmable.
Single Plane (value = 1)
3-Plane RGB (value = 3)
Index Color
0White
1Black
Index Color
0Black
1Red
2Green
3Yellow
4Blue
5 Magenta
6Cyan
7White
3-12 Using Palettes EN
3-Plane CMY (value = –3)
Index Color
0White
1Cyan
2 Magenta
3Blue
4Yellow
5Green
6Red
7Black
EN Using Palettes 3-13
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 RGB and sRGB Palettes
Bits/Index = 1
Bits/Index = 2
Bits/Index = 3 through 8
Index Color
0White
1Black
Index Color
0Black
1Red
2Green
3White
Index Color
0Black
1Red
2Green
3Yellow
4Blue
5 Magenta
6Cyan
7White
n > 7 Black
3-14 Using Palettes EN
Device CMY Palettes
Bits/Index = 1
Bits/Index = 2
Bits/Index = 3 through 8
Index Color
0White
1Black
Index Color
0White
1Cyan
2 Magenta
3Black
Index Color
0White
1Cyan
2 Magenta
3Blue
4Yellow
5Green
6Red
7Black
n > 7 Black
EN Using Palettes 3-15
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. Like a default CID
palette, a default HP-GL/2 palette can be modified in either PCL or
HP-GL/2 contexts using the following commands:
PCL
Color Components 1, 2, and 3 (?*v#A, ?*v#B, ?*v#C)
Assign Color Index (?*v#I)
HP-GL/2
Number of Pens (NP)
Pen Color Assignment (PC)
Note The IN command always establishes the 8-pen palette.
Two Pens
Four Pens
Pen Number Color
0White
1Black
Pen Number Color
0White
1Black
2Red
3Green
3-16 Using Palettes EN
Eight Pens
Pen Number Color
0White
1Black
2Red
3Green
4Yellow
5Blue
6 Magenta
7Cyan
n > 7 Black
EN Using Palettes 3-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.
?*v#S
Specified values that are out-of-range of the current palette are
mapped into a new index as follows:
Index = Specified foreground index modulo palette size
For example, specifying a foreground color index of 10 when the
current palette size is 8 maps to 10 modulo 8, which is equal to 2. If
the current palette was created under HP-GL/2, the index is mapped
according to the HP-GL/2 mapping function.
Foreground color affects the following PCL page marking primitives:
Text characters (they change to the foreground color, including
underlining)
Solid or monochrome patterned rectangular area fills (rules)
Monochrome patterns (except HP-GL/2)
Raster images
The following are not affected:
User-defined color patterns (format 1 download patterns)
HP-GL/2 marking primitives (HP-GL/2 uses “selected pen”, but
ignores foreground color)
# = Index number into current palette
Default =0
Range = 0 to 2(current palette size) – 1
3-18 Using Palettes EN
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.
After a foreground color is selected, changing any of the following will
not change foreground color until a new Foreground Color command
(?*v#S) is issued:
Active Palette
Configure Image Data (CID) command
Render Algorithm
EN Using Palettes 3-19
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 One
This command specifies the first component of the palette entry
designated by the Assign Color Index command (?*v#I).
?*v#A
The Assign Color Index command actually applies this value and then
resets it to 0.
Color Component Two
This command specifies the second component of the palette entry
designated by the Assign Color Index command.
?*v#B
The Assign Color Index command actually applies this value and then
resets it to 0.
# = First Component
Default =0
Range = –32767.0000 to 32767.0000 (up to 4 decimal places;
command is ignored for invalid configurations)
# = Second Component
Default =0
Range = –32767.0000 to 32767.0000 (up to 4 decimal places;
command is ignored for invalid configurations)
3-20 Using Palettes EN
Color Component Three
This command specifies the third component of the palette entry
designated by the Assign Color Index command.
?*v#C
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.
?*v#I
This command resets the color components to 0 after assignment. If
the specified index number is greater than the palette size, no index
assignment is made, but the three color components are set to 0.
# = Third Component
Default =0
Range = –32767.0000 to 32767.0000 (up to 4 decimal places;
command is ignored for invalid configurations)
# = Index Number
Default =0
Range = 0 to 2n – 1, where n is the number of bits per index (no
assignment for out-of-range values)
EN Modifying Output Color 4-1
4Modifying 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. The HP color printers can modify
colors using the following means:
Halftone render algorithms provide a way to modify images
based on a dither cell concept. The algorithm chosen
determines how specified colors are “rendered” as dots on the
printed page.
The Monochrome Print Mode command converts each color to
its grayscale equivalent for faster, draft printing.
The Driver Configuration command provides a way to select a
color treatment.
The Finish Mode command allows the user to specify the
finish, matte or glossy, to be applied to the document.
All of these methods of modifying output color are explained in the
following sections.
4-2 Modifying Output Color EN
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.
To choose the type of rendering to be used, use the Render Algorithm
command, described below.
Render Algorithm Command
The Render Algorithm command selects the algorithm to be used for
rendering page marking entities on a given page.
?*t#J
Device Best Dither
This dither pattern produces the best results for many images. Note,
however, that the recommended dither pattern varies with the image,
the intended use of the image, and the subjective judgements of the
user.
# = 0 - Continuous tone detail (high lpi) (device best dither)
3 - Device best dither
15 - Continuous tone smooth (high lpi)
18 - Continuous tone basic (low lpi)
Default = 3
Range = 0, 3, 15, 18 (invalid values are ignored)
EN Modifying Output Color 4-3
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.
?&b#M
This command must be sent prior to printable data, or it is ignored.
The command must be sent at the start of a job, since few, if any,
applications support a mixture of color and monochrome printing of
color images within the same document.
# = 0 - Print in mixed render algorithm mode
1 - Print using gray-scale equivalent
Default =0
Range = 0, 1 (command is ignored for invalid values)
4-4 Modifying Output Color EN
Driver Configuration Command
This command specifies the color treatment applied to each color
specification.
?*o#W[device_id function_index Arguments]
device_id
function_index
The following paragraphs describe the function_index values and
their arguments.
Select Treatment
This value specifies which color treatment mode to use for rendering
the next job.
Vivid Graphics
This setting adds color saturation to the resulting image, and provides
access to the full gamut of the printer (at the cost of color matching).
#= Specifies the number of bytes to follow (device ID
function index arguments)
Default =N/A
Range = see description below
Value Printer
6 Color LaserJet printer family
8 Color LaserJet 4500 printer
function_
index Description Argument Range
4Select Color
Treatment 3 Vivid Graphics
6 Screen Match
EN Modifying Output Color 4-5
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. This is the preferred mode of
operation to provide a good appearance match between the monitor
and the printed document
The table below lists the driver configuration commands for both color
treatments:
Note The device_id and function_index arguments after the ?*o3W (such
as 643) should actually be entered as ASCII-coded decimal. For
example, instead of 643 you would actually enter the ACK control
code, followed by the EOT and ETX control codes.
Treatment Command
LJ 4500 Other Color LaserJet
Family printers
Vivid Graphics ?*o3W843 ?*o3W643
Screen Match ?*o3W846 ?*o3W646
4-6 Modifying Output Color EN
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.
?&b#F
The finish mode must be set before the first page is marked and
applies to all the pages in the document. Each document defaults to a
matte finish.
# = 0 - Matte finish
1 - Glossy finish
Default =0
Range = 0, 1 (command is ignored for invalid values)
EN The PCL Print Model 5-1
5The 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.
Figure 5-1 illustrates the use of the print model. The following
definitions are helpful in describing Print Model operation:
Figure 5-1 Print Model Imaging
5-2 The PCL Print Model EN
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. Once the current pattern is specified, it
stays in effect until another is selected or the printer is reset. A
reset returns the current pattern to its default value (100%
black). The current pattern does not always apply to
rectangular area fill, which uses patterns defined by the
rectangular area fill pattern commands.
Foreground Color—Foreground color is selected from the
current palette using the Foreground Color command
(?*v#S). Foreground color affects everything except
user-defined color patterns and HP-GL/2 primitives. Raster
color mixes with foreground color (see Chapter 6 “Color Raster
Graphics”).
Texture—Texture is another name for the combination of
pattern and foreground color, or for a color pattern which is not
combined with a foreground color.
Source Imagethe Source Image is an image in which the
non-white bits are replaced by the specified pattern. The
source image functions like a stencil through which the pattern
is applied to the destination image. The source image may be
one of the following: HP-GL/2 primitives, rules, characters, or
raster images (single plane mask or multi-plane color)
Destination Image—The image onto which the source
image/texture combination is placed. The destination image
includes any images placed through previous operations.
Source Transparency Mode—The transparency or
opaqueness of the source image’s “white” pixels as they are
applied to the destination image (see the note below). Setting
the source transparency mode to 1 (opaque) applies the
source image's white pixels to the destination image; with a
setting of 0 (transparent), these pixels have no effect on the
destination.
EN The PCL Print Model 5-3
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. The Logical Operations command (?*l#O)
can vary the logical operation used, thus varying the outcome.
Note For RGB color images, “white” pixels are those for which all color
primaries are 255. For CMY color images, “white” pixels are those for
which all color primaries are 0.
For all rendering algorithms, white dots introduced in the dithering
process are not subject to transparency modes.
Figure 5-2 illustrates the effects of the source and pattern
transparency modes on the final image. (The transparency modes
work a little differently with rectangular area fill—see “Pattern
Transparency for Rectangular Area Fill” near the end of this chapter.)
Figure 5-2 Opaque and Transparency Modes
This example uses the default ROP. The output may appear differently
depending on the colors used.
5-4 The PCL Print Model EN
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.
In the second example (1b), the source mode is still “transparent,” but
the pattern mode is “opaque” – so the pattern's white pixels are
applied to the destination. The resulting image shows the entire circle
region visible and patterned.
In the third example (1c), the source mode is “opaque” and the
pattern mode is transparent. Since the source mode is opaque, the
entire source image (the circle and the surrounding square) appears
overlaid onto the destination. The pattern, however, is allowed to pour
through only onto the white-pixeled area of the destination. The circle
is visible in the result, but only two opposing quarters appear
patterned.
In the fourth example (1d), both source and pattern modes are
“opaque.” The entire source image is overlaid onto the destination,
and the entire circle is patterned.
EN The PCL Print Model 5-5
Figure 5-3 Effect of Transparency Modes on Images
5-6 The PCL Print Model EN
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 Comments
Download Page Data Prior raster and character data
downloaded to the page is considered
destination image.
Select Transparency Modes ?*v#N (source) and/or ?*v#O (pattern)
Specify the Logical Operation If a logical operation other than the default
(TSo-252) is desired, specify the
operation with the ?*l#O command.
Select Specific Pattern ID Pattern ID ?*c#G
Download User-Defined Pattern If using a user-defined pattern, it must be
downloaded to the printer before using it.
Select Pattern ?*v4T (selects downloaded pattern)
Specify the Foreground Color For color printers, specify a Foreground
Color (?*v#S) if desired. (This step is
unnecessary if a color pattern is used.)
Download Source Image Data Raster image/characters
Return to regular print mode Default current pattern and transparency
modes: ?*v0T (100% black pattern
selected) and ?*v0N ?*v0O
(transparency modes selected).
Download remaining page data Transfer data for regular printing, or the
above process may be repeated to
produce another print model effect.
End of Page Data
EN The PCL Print Model 5-7
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
With a transparency mode of “0” (transparent), the white regions of
the source image are not copied onto the destination. With a
transparency mode of “1” (opaque), the white pixels in the source are
applied directly onto the destination. White pixels are unaffected by
pattern or foreground color; they are either white or transparent.
Note For RGB color images, “white” pixels are those for which all color
primaries are 255. For CMY color images, “white” pixels are those for
which all color primaries are 0.
White dots introduced in the dithering process are not subject to
transparency modes.
Refer to the preceding definitions and the discussion of Figure 5-3 for
an explanation of the effects of source transparency.
# = 0 - Transparent
1 - Opaque
Default =0
Range = 0, 1 (other values cause the command to be ignored)
5-8 The PCL Print Model EN
Pattern Transparency Mode Command
The Pattern Transparency Mode command sets the pattern's
transparency mode to transparent or opaque.
? * v # O
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.
Note When printing white rules, the pattern transparency is treated as if it
were “opaque”; white rules erase black rules regardless of the
transparency mode.
For RGB color images, “white” pixels are those for which all color
primaries are 255. For CMY color images, “white” pixels are those for
which all color primaries are 0.
White dots introduced in the dithering process are not subject to
transparency modes.
Refer to the preceding definitions and the discussion of Figure 5-2
and Figure 5-3 for an explanation of the effects of pattern
transparency.
# = 0 - Transparent
1 - Opaque
Default =0
Range = 0, 1 (other values cause the command to be ignored)
EN The PCL Print Model 5-9
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.
The print model process consists of the following steps:
1Specify source and/or pattern transparency modes, if desired.
2Specify the logical operation (or use the default).
3Define the desired operands (source, destination, pattern).
Definitions
Source: The source image may be one of the following:
HP-GL/2 primitives
• Rules
• Characters
Raster images (single plane mask or multiplane color)
Destination: The destination image contains whatever is currently
defined on the page. It includes any images placed through previous
operations.
Pattern or Texture: The pattern is defined by the Select Current
Pattern command (?*v#T). The terms pattern and texture are used
interchangeably in this section.
Transparency Modes: The white pixels of the source and/or pattern
may be made transparent (source transparency 0, pattern
transparency 0). The destination shows through these areas.
Transparency modes are set by the Source Transparency (?*v#N)
and Pattern Transparency (?*v#O) commands.
The Print Model allows logical operations, such as AND, OR, XOR,
NOT, to be performed on source, texture, and destination images.
Transparency modes and Logical Operation must be specified before
printable data is sent.
5-10 The PCL Print Model EN
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).
Destination: current page definition
Operation
IF (source transparent && source == white) RETURN
destination
IF (pattern transparent && pattern == white &&
source != white) RETURN destination
ELSE RETURN (logical op (source, texture, destination)
EN The PCL Print Model 5-11
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. In RGB space, a “1”' is white and a “0” is black.
5-12 The PCL Print Model EN
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.
The four basic interactions are:
Case 1: Source and Pattern are opaque.
Texture = Color & Pattern.
RETURN ROP3 ( Dest, Src, Texture ).
Case 2: Source is opaque, Pattern is transparent.
Texture = Color & Pattern.
Temporary_ROP3 = ROP3 ( Dest, Src, Texture ).
Image_A = Temporary_ROP3, & Not Src.
Image_B = Temporary_ROP3 & Pattern.
Image_C = Not Pattern & Src & Dest.
RETURN Image_A | Image_B | Image_C
Case 3: Source is transparent, Pattern is opaque.
Texture = Color & Pattern.
Temporary_ROP3 = ROP3 ( Dest, Src, Texture ).
Image_A = Temporary_ROP3 & Src.
Image_B = Dest & Not Src.
RETURN Image_A | Image_B
Case 4: Source and Pattern are transparent
Texture = Color & Pattern.
Temporary_ROP3 = ROP3 ( Dest, Src, Texture ).
Image_A = Temporary_ROP3 & Src & Pattern.
Image_B = Dest & Not Src.
Image_C = Dest & Not Pattern.
RETURN Image_A | Image_B | Image_C.
Note The Transparency Mode is applied based on the color of each pixel.
However, the Logical Operation is applied on a bit-by-bit basis without
regard to color. In order to obtain a result consistent with the Logical
Operation, the transparency modes should be set to Source Opaque
and Pattern Opaque. In order to obtain a result consistent with the
desired transparency mode, the Logical Operation should be set to
252 and the foreground color set to black.
EN The PCL Print Model 5-13
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.
?*l # O
The Logical Operation code, or Raster OPeration (ROP) code, is
simply a systematic method of encoding all of the 256 possible ways
that a Texture, Source, and Destination can be combined. Table 5-4
gives a table of ROPs from ROP 0 to ROP 255, where each operation
is defined as a logic equation. This table can be difficult to understand
and use. Furthermore, it does not show the differences that depend
on the color space. A truth table is an alternative method for
understanding the results of a logical operation. When used with
ROPs for finding the resulting destination value, it is more easily
understood than the logic operation.
1 The first destination column is ignored and the second destination column is the result
of the ROP (White = [1,1,1] and Black = [0,0,0] ).
# = Logical operation value (see Table 5-4)
Default = 252 (TSo)
Range = 0 to 255
ROPRGB 252 (11111100)1
(T)exture (S)ource (D)estination (D)estination
11 1 1
11 0 1
10 1 1
10 0 1
01 1 1
01 0 1
00 1 0
00 0 0
5-14 The PCL Print Model EN
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).
It’s possible to derive the logical operation for a truth table and to
create a truth table for a logical operation. However, the most
important point is that the binary value of the ROPs number gives the
Destination for all possible combinations of Texture, Source, and
Destination.
The way the bits of the ROPs number map to the combinations of
Texture, Source, and Destination depends on whether the color space
is RGB or CMY. The least significant bit of the RGB ROP value maps
to (0, 0, 0), the color black in RGB, and the most significant bit to
(1, 1, 1), white in RGB. On the other hand, the CMY ROP reverses
the mapping. This reversal hinges on the fact that RGB and CMY are
the inverse of each other, i.e., RGB Black is (0, 0, 0) and CMY Black
is (1, 1, 1), white. All other colors show the same relationship.
ROPs in the RGB Color Space
The RGB ROP truth tables shown in Table 5-1 illustrate how ROP 252
and ROP 90 work, and most importantly how the bits in the ROP map
show destination values for each combination of Texture, Source and
Destination. A “1” in the RGB color space represents white and a “0
black, which makes determining what shows on paper cumbersome
for users since the paper is marked when the Destination has a “0”
value.
EN The PCL Print Model 5-15
Table 5-1. RGB ROP Truth Tables
ROPs in the CMY Color Space
The CMY ROP truth tables in Table 5-2 shows examples of how the
ROPs number determines the value of the Destination for all
combinations of Texture, Source, and Destination. In the CMY color
space a “0” is the absence of ink (white) and a “1” is the presence of
ink (black), the opposite of the RGB color space value for black and
white. Therefore, the ROPs results (Destination values) for the CMY
color space are the opposite (negation) of the RGB values. However,
a CMY ROP is easier to use when determining if the page is marked,
since a “1” denotes marking.
ROPrgb 252 ROPrgb 90 ROPrgb n
(11111100) (01011010) n=(b7b6b5b4b3b2b1b0)
TSDD TSDD TSDROP nD
1111 white 1110 white 111b
7b7
1101 1101 110b
6b6
1011 1010 101b
5b5
1001 1001 100b
4b4
0111 0111 011b
3b3
0101 0100 010b
2b2
0010 0011 001b
1b1
0000 black 0000 black 000b
0b0
5-16 The PCL Print Model EN
Table 5-2. CMY ROP Truth Tables
Using a ROP
The first step in using a ROP is to determine which color space you're
in: RGB or CMY. Then determine the binary value of the ROP used.
For example, suppose you want to use ROP 90 in the CMY color
space. The binary equivalent of 90 is 01011010 when written in most
significant to least significant bit order.
Looking at the truth table for ROP 90 in Table 5-2 you can see that the
only time the page is marked is when the Texture and Destination are
both “0” or both “1.” However, the same result is given by negating
each bit of the ROP number, 90, to give 10100101. Using the general
table for CMY ROPs (the rightmost table in Table 5-2) you can plug
the bit values from 90 into b7 through b0 to obtain the values in the
truth table for ROP 90. Similarly, using ROP 90 in the RGB color
space entails plugging 01011010 in the general table for RGB ROPS
(the rightmost table in Table 5-1) to obtain the values in the truth table
for ROPrgb 90 (also in Table 5-1). This process works for any value
from 0 to 255 and can be used to determine what will show for any
given ROP, in either the RGB or CMY color spaces.
ROPcmy 252 ROPcmy 90 ROPcmy n
(00000011) (10100101) n=(b7b6b5b4b3b2b1b0)
TSDD TSDD TSDROP nD
0000 white 0001 white 000b
7!b7
0010 0010 001b
6!b6
0100 0101 010b
5!b5
0110 0110 011b
4!b4
1000 1000 100b
3!b3
1010 1011 101b
2!b2
1101 1100 110b
1!b1
1111 black 1111 black 111b
0!b0
EN The PCL Print Model 5-17
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. To convert from one color space to the other, write the ROP in
binary format, invert the bits, and reverse the order.
When source and/or pattern transparency modes are set opaque (not
defaulted), values specified by this command map directly to the
ROP3 (raster operation) table values on the following page. However,
when source and/or pattern transparency modes are set transparent,
the additional operations shown on the previous page must be
performed to achieve the final result.
Logical operations in the table are shown in RPN (reverse polish
notation). For example, the value 225 corresponds to TDSoxn, the
logical function of:
NOT (texture XOR (destination OR source))
Note ?*l # O is the PCL Version of the HP-GL/2 MC command.
This command sets the ROP value which affects not only PCL
operation but also the HP-GL/2 ROP value.
EXAMPLE
The Logical Operation default value is 252 (TSo), corresponding to a
logical function of:
(texture | source)
5-18 The PCL Print Model EN
The result is computed below (source and pattern opaque).
Table 5-3. Logical Operation (ROP3)
Each column of destination, source, and texture values are the input
to the logical function. The result, 252, is the value that would be sent
to identify the logical operation (refer to page 5-12 for source/pattern
transparency interactions).
Table of Logical Operations
The Logical Operations (ROP3) table (Table 5-4) shows the mapping
between input values and their logical operations. Note that the
logical operations are specified as RPN (reverse polish notation)
equations. Here is a key to describe what the Boolean Function
values mean;
Note Since logical operations are interpreted in RGB space (white = 1 and
black = 0) rather than in CMY space (white = 0 and 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 something similar to a CMY space and inverts
the bits and reverses the order.
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) 11111100
(decimal 252)
S = Source a = AND
T = Texture o = OR
D = Destination n = NOT
x = EXCLUSIVE OR
EN The PCL Print Model 5-19
Table 5-4. Logical Operations (ROP3)
Input Value Boolean
Function Input Value Boolean
Function
0 0 27 SDTSxaxn
1 DTSoon 28 TSDTaox
2 DTSona 29 DSTDxaxn
3 TSon 30 TDSox
4 SDTona 31 TDSoan
5DTon32DTSnaa
6 TDSxnon 33 SDTxon
7 TDSaon 34 DSna
8 SDTnaa 35 STDnaon
9 TDSxon 36 STxDSxa
10 DTna 37 TDSTanaxn
11 TSDnaon 38 SDTSaox
12 STna 39 SDTSxnox
13 TDSnaon 40 DTSxa
14 TDSonon 41 TSDTSaoxxn
15 Tn 42 DTSana
16 TDSona 43 SSTxTDxaxn
17 DSon 44 STDSoax
18 SDTxnon 45 TSDnox
19 SDTaon 46 TSDTxox
20 DTSxnon 47 TSDnoan
21 DTSaon 48 TSna
22 TSDTSanaxx 49 SDTnaon
23 SSTxDSxaxn 50 SDTSoox
24 STxTDxa 51 Sn
25 SDTSanaxn 52 STDSaox
26 TDSTaox 53 STDSxnox
5-20 The PCL Print Model EN
Table 5-4. Logical Operations (ROP3) (continued)
Input Value Boolean
Function Input Value Boolean
Function
54 SDTox 81 DSTnaon
55 SDToan 82 DTSDaox
56 TSDToax 83 STDSxaxn
57 STDnox 84 DTSonon
58 STDSxox 85 Dn
59 STDnoan 86 DTSox
60 TSx 87 DTSoan
61 STDSonox 88 TDSToax
62 STDSnaox 89 DTSnox
63 TSan 90 DTx
64 TSDnaa 91 DTSDonox
65 DTSxon 92 DTSDxox
66 SDxTDxa 93 DTSnoan
67 STDSanaxn 94 DTSDnaox
68 SDna 95 DTan
69 DTSnaon 96 TDSxa
70 DSTDaox 97 DSTDSaoxxn
71 TSDTxaxn 98 DSTDoax
72 SDTxa 99 SDTnox
73 TDSTDaoxxn 100 SDTSoax
74 DTSDoax 101 DSTnox
75 TDSnox 102 DSx
76 SDTana 103 SDTSonox
77 SSTxDSxoxn 104 DSTDSonoxxn
78 TDSTxox 105 TDSxxn
79 TDSnoan 106 DTSax
80 TDna 107 TSDTSoaxxn
EN The PCL Print Model 5-21
Table 5-4. Logical Operations (ROP3) (continued)
Input Value Boolean
Function Input Value Boolean
Function
108 SDTax 135 TDSaxn
109 TDSTDoaxxn 136 DSa
110 SDTSnoax 137 SDTSnaoxn
111 TDSxnan 138 DSTnoa
112 TDSana 139 DSTDxoxn
113 SSDxTDxaxn 140 SDTnoa
114 SDTSxox 141 SDTSxoxn
115 SDTnoan 142 SSDxTDxax
116 DSTDxox 143 TDSanan
117 DSTnoan 144 TDSxna
118 SDTSnaox 145 SDTSnoaxn
119 DSan 146 DTSDToaxx
120 TDSax 147 STDaxn
121 DSTDSoaxxn 148 TSDTSoaxx
122 DTSDnoax 149 DTSaxn
123 SDTxnan 150 DTSxx
124 STDSnoax 151 TSDTSonoxx
125 DTSxnan 152 SDTSonoxn
126 STxDSxo 153 DSxn
127 DTSaan 154 DTSnax
128 DTSaa 155 SDTSoaxn
129STxDSxon156 STDnax
130DTSxna157DSTDoaxn
131 STDSnoaxn 158 DSTDSaoxx
132SDTxna159TDSxan
133 TDSTnoaxn 160 DTa
134 DSTDSoaxx 161 TDSTnaoxn
5-22 The PCL Print Model EN
Table 5-4. Logical Operations (ROP3) (continued)
Input Value Boolean
Function Input Value Boolean
Function
162 DTSnoa 189 SDxTDxan
163 DTSDxoxn 190 DTSxo
164 TDSTonoxn 191 DTSano
165TDxn192 TSa
166 DSTnax 193 STDSnaoxn
167 TDSToaxn 194 STDSonoxn
168 DTSoa 195 TSxn
169DTSoxn196STDnoa
170 D 197 STDSxoxn
171 DTSono 198 SDTnax
172 STDSxax 199 TSDToaxn
173DTSDaoxn200 SDToa
174 DSTnao 201 STDoxn
175DTno202DTSDxax
176 TDSnoa 203 STDSaoxn
177TDSTxoxn204 S
178 SSTxDSxox 205 SDTono
179 SDTanan 206 SDTnao
180 TSDnax 207 STno
181 DTSDoaxn 208 TSDnoa
182 DTSDTaoxx 209 TSDTxoxn
183SDTxan210TDSnax
184 TSDTxax 211 STDSoaxn
185DSTDaoxn212SSTxTDxax
186 DTSnao 213 DTSanan
187DSno214TSDTSaoxx
188 STDSanax 215 DTSxan
EN The PCL Print Model 5-23
Table 5-4. Logical Operations (ROP3) (continued)
Input Value Boolean
Function Input Value Boolean
Function
216 TDSTxax 236 SDTao
217 SDTSaoxn 237 SDTxno
218 DTSDanax 238 DSo
219STxDSxan239 SDTnoo
220 STDnao 240 T
221SDno241TDSono
222 SDTxo 242 TDSnao
223 SDTano 243 TSno
224 TDSoa 244 TSDnao
225TDSoxn245 TDno
226 DSTDxax 246 TDSxo
227TSDTaoxn247 TDSano
228 SDTSxax 248 TDSao
229TDSTaoxn249 TDSxno
230 SDTSanax 250 DTo
231 STxTDxan 251 DTSnoo
232 SSTxDSxax 252 TSo
233 DSTDSanaxxn 253 TSDnoo
234 DTSao 254 DTSoo
235DTSxno255 1
5-24 The PCL Print Model EN
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. For example, a source rectangle consisting of all 1’s that is
XORed with a destination consisting of all 1’s produces a white
rectangle; but if another source rectangle is placed on the page
touching the first rectangle, the two rectangles will be white-filled
except at their common border ( (1^1) ^ 1 = 1).
To correct situations where this problem occurs, the PCL printer
language provides a choice of pixel placement models: grid
intersection and grid centered. The grid intersection model is the
default: pixels are rendered on the intersections of the
device-dependent grid covering the page. In the grid-centered model,
the number of rows and columns are each reduced by one, and pixels
are placed in the center of the squares, rather than at the
intersections.
The following example illustrates the concepts of the two models (see
Figure 5-5). Assume a rectangle extends from coordinate position
(1,1) to position (3,4). As shown below, for the same coordinates, the
grid-centered model produces a rectangle that is one dot row thinner
and one dot row shorter than the grid intersection model. Thus, the
grid-centered model should be selected when two or more polygons
on a page may share a common border.
Since PCL printers print only at the intersections of the grid, the
actual implementation of the grid-centered model is shown on the
right.
EN The PCL Print Model 5-25
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.
5-26 The PCL Print Model EN
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).
EN The PCL Print Model 5-27
Pixel Placement Command
Determines how pixels are rendered in images.
?*l # R
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.
Note The PCL Pixel Placement command determines how pixels are
placed for both PCL and HP-GL/2 operation.
This command performs the same function as the HP-GL/2 PP
command described in Chapter 7.
# = 0 - Grid intersection
1 - Grid centered
Default =0
Range = 0, 1 (command is ignored for other values)
5-28 The PCL Print Model EN
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.
1Specify the Pattern ID (?*c#G) command. For HP-defined
patterns, select an ID that specifies the desired pattern.
2Download the pattern (?*c#W). This step is for user-defined
patterns only. The downloaded pattern adopts the current
pattern ID.
3Apply the pattern to all subsequent text and raster images.
Specify the current pattern type (?*v#T).
Patterns for Rectangles
Use the following general procedure to apply a non-solid pattern to
rectangular areas.
1Specify the Pattern ID (?*c#G). For HP-defined patterns, select
an ID that matches an HP-defined pattern.
2Download the pattern (?*c#W). This step is for user-defined
patterns only. The downloaded pattern adopts the current
pattern ID.
3Define the rectangle. Position the cursor and specify the
rectangle size (?*c#A, ?*c#B or ?*c#H, ?*c#V).
4Apply the pattern to the rectangle. Send the Fill Rectangular Area
command (?*c#P).
HP-GL/2 Patterns
PCL patterns can be used in HP-GL/2 mode, but HP-GL/2 patterns
cannot be used in PCL mode. Using HP-GL/2, patterns are
downloaded using the RF (Raster Fill) command, and applied using
the FT (Fill Type) or SV (Screened Vectors) commands.
EN The PCL Print Model 5-29
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.)
? * c # G
For rectangular areas, the pattern “material” is determined by both
the pattern ID and the value of the Fill Rectangular Area command.
For other images, the pattern material is determined by the pattern ID
and the value of the Select Pattern command.
Figure 5-7 and Figure 5-8 illustrate the HP-defined shading patterns
and cross-hatched patterns, respectively.
Note This command is used for both the Select Pattern and Rectangular
Area Fill graphics.
For user-defined patterns, this command, sent prior to downloading a
user-defined pattern, assigns an ID pattern number to the
downloaded pattern. (For more information, see “User-Defined
Pattern Graphics,” later in this chapter.)
Selecting Shaded patterns: Selecting Cross-Hatch
patterns:
# = 1 thru 2 = 1- 2% shade # = 1 - Pattern #1
3 thru 10 = 3-10% shade 2 - Pattern #2
11 thru 20 = 11-20% shade 3 - Pattern #3
21 thru 35 = 21-35% shade 4 - Pattern #4
36 thru 55 = 36-55% shade 5 - Pattern #5
56 thru 80 = 56-80% shade 6 - Pattern #6
81 thru 99 = 81-99% shade
100 = 100% shade
Selecting User-Defined patterns:1
# = ID number of user-defined pattern
1 Not supported on all PCL 5 printers. Refer to the “PCL Feature Support Matrix” in
Chapter 1 of the PCL 5 Comparison Guide for specifics.
Default = 0 (no pattern)
Range = 0 – 32767 (values outside the range are ignored)
5-30 The PCL Print Model EN
Figure 5-7 Shading Patterns
EN The PCL Print Model 5-31
Figure 5-8 Cross-Hatch Patterns
5-32 The PCL Print Model EN
Select Current Pattern Command
The Select Current Pattern command identifies the type of pattern to
be applied onto the destination.
? * v # T
This command selects which type of pattern is applied. For values 2,
3, and 4, the desired shading level, cross-hatch pattern, or
user-defined pattern number is identified by the Pattern ID command
described earlier in this chapter.
Note For selecting or changing the current pattern, the Select Current
Pattern (?*v#T) and the Pattern ID (?*c#G) commands work
together. Sending the current pattern (Select Current Pattern
command) alone does not change the current pattern; the Pattern
ID must be sent first. However, when selecting solid white (white
rule) or solid black (black rule), only the Select Current Pattern
command is required.
Once a current pattern is selected, that pattern applies to all images
placed on the page until a new pattern is selected.
# = 0 - Solid black or foreground color
1 - Solid white
2 - Shading pattern
3 - Cross-hatch pattern
4 - User-defined pattern
Default =0
Range = 0 - 4 (values outside of range are ignored)
EN The PCL Print Model 5-33
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. This base pattern is downloaded to the printer using
the User-Defined Pattern command. Prior to downloading the pattern,
a Pattern ID command is sent to assign the user pattern an ID
number. This ID number is used to select the pattern for printing and
for pattern management.
To apply the pattern to an image, the printer duplicates or tiles (like
placing ceramic tiles) the pattern across and down the page. This
pattern can be applied to any image, including rectangular area fill.
Figure 5-9 User-Defined Base Pattern Example
A user-defined pattern may be applied to any image in the same
manner as the internal cross-hatch or shade patterns.
5-34 The PCL Print Model EN
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.
How the Printer Tiles a Pattern
A user-defined base pattern is a rectangular binary pattern stored in
the printer. To apply the pattern to an image area on the page, the
printer duplicates the base pattern across and down the page. This
process is referred to as tiling. (The pattern is only applied to those
areas on the page for which the pattern is required.)
EN The PCL Print Model 5-35
Figure 5-10 Pattern Layout Across the Printable Area
5-36 The PCL Print Model EN
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. The pattern
reference point may be shifted more than once for as many fill areas
as there are on a page (the area must be filled before the tile point is
moved for the next fill area).
Figure 5-11 shows two areas filled with the pattern reference point
fixed at the default (0,0) position. The lower portion of the illustration
shows two areas in which the pattern reference point was moved to
the upper left corner of each area and the area filled separately.
EN The PCL Print Model 5-37
Figure 5-11 Moving Pattern Reference Point for Pattern Filling
5-38 The PCL Print Model EN
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]
The value field (#) identifies the number of pattern data bytes that
follow the Download Pattern command. In addition to the binary
pattern data, there are eight bytes of pattern descriptor (header)
information included in this pattern data. The format for a 300 dpi
resolution header is shown in Table 5-5, below.
Table 5-5. User-Defined Pattern Header (300 dpi resolution)
Format (Byte 0)
This field indicates the downloadable pattern format:
# = 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)
Byte 15 - MSB 8 7 LSB-0 Byte
0 Format (0) Continuation (0) 1
2 Pixel Encoding (1) Reserved (0) 3
4 Height in Pixels 5
6 Width in Pixels 7
8 Pattern image
Format 0 1 bit per pixel: black-and-white or foreground color. A
“1” bit indicates black or foreground color for a color
pattern. A “0” indicates either white or transparency,
depending on the source and pattern transparency
modes. A “0” cannot be colored.
Format 1 1 or 8 bits per pixel. This format uses the current
palette. Data is sent pixel by pixel, and the bits/index
field of the pixel encoding byte determines the
number of bits defining a pixel.
EN The PCL Print Model 5-39
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. If the value of any byte is greater than the current palette size,
the modulo function is applied when rendering.
Reserved (Byte 3)
This field, byte 3, is not currently used and must be set to 0.
Height in Pixels (Bytes 4 and 5)
This field, bytes 4 and 5, identifies the number of raster rows (height)
of the pattern, specified at device resolution. If the height is 0, the
data is ignored and no pattern is defined. Pattern height must be less
than 32767 pixels.
Width in Pixels (Bytes 6 and 7)
This field, bytes 6 and 7, identifies the number of pixels (width) of the
pattern, specified at device resolution. If the width is 0, the data is
ignored and no pattern is defined. Pattern width must be less than
32767 pixels.
Pattern Image
This field contains the raster data for the pattern. Data rows must be
word-aligned. Pattern image data is formatted differently for each
format type (see the data description under “Format (Byte 0)” on the
previous page).
7 5 4 3 0
000 Unused Bits/Index
5-40 The PCL Print Model EN
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). The base pattern binary data is shown below:
11111111111111111111111111111111
01111111111111111111111111111110
00111111111111111111111111111100
00011111111111111111111111111000
00001111111111111111111111110000
00000111111111111111111111100000
00000011111111111111111111000000
00000001111111111111111110000000
00000000111111111111111100000000
00000000011111111111111000000000
00000000001111111111110000000000
00000000000111111111100000000000
00000000000011111111000000000000
00000000000001111110000000000000
00000000000000111100000000000000
00000000000000011000000000000000
This translates into the following 64 bytes of hexadecimal values:
FF FF FF FF
7F FF FF FE
3F FF FF FC
1F FF FF F8
0F FF FF F0
07 FF FF E0
03 FF FF C0
01 FF FF 80
00 FF FF 00
00 7F FE 00
00 3F FC 00
00 1F F8 00
00 0F F0 00
00 07 E0 00
00 03 C0 00
00 01 80 00
EN The PCL Print Model 5-41
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. Specify the pattern ID number:
2. Send the User-defined Pattern command:
?*c3G Assigns an ID number of 3 to the pattern
data which follows.
?*c72W Specifies that 72 bytes are to follow (8
bytes for the header plus 64 bytes of
pattern data).
5-42 The PCL Print Model EN
Send the pattern header and binary data:
00 00 01 00 00 10 00 20
FF FF FF FF
7F FF FF FE
3F FF FF FC
1F FF FF F8
0F FF FF F0
07 FF FF E0
03 FF FF C0
01 FF FF 80
00 FF FF 00
00 7F FE 00
00 3F FC 00
00 1F F8 00
00 0F F0 00
00 07 E0 00
00 03 C0 00
00 01 80 00
Note 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.
In the previous example, the raster data code is presented in
hexadecimal, however, the numbers in the escape sequences are
decimal.
EN The PCL Print Model 5-43
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
A value field of 0 rotates the patterns with changes in the print
direction (see Print Direction command). For a value field of 1,
patterns remain fixed for changes in print direction.
The default pattern reference point is the upper left corner of the
logical page at the top margin (position 0,0). If the Set Pattern
Reference Point command is not set, the pattern is tiled with respect
to the default reference point.
Note All patterns are rotated for changes in orientation, but the pattern
reference point remains the same (refer to “Logical Page Orientation
Command” in Chapter 5 of the PCL 5 Printer Language Technical
Reference Manual).
This command applies to user-defined, shading, and cross-hatch
patterns.
# = 0 - Rotate patterns with print direction
1 - Keep patterns fixed
Default =0
Range = 0,1 (values outside the range are ignored)
5-44 The PCL Print Model EN
Pattern Control Command
The Pattern Control command provides a means for manipulating
user-defined patterns.
? * c # Q
For value fields 2, 4, and 5, the Pattern ID (?*c#G) command is sent
prior to the Pattern Control command to identify the specific pattern to
which the Pattern Control command action is applied.
# = 0 - Delete all patterns (temporary & permanent)
1 - Delete all temporary patterns
2 - Delete pattern (last ID # specified)
4 - Make pattern temporary (last ID # specified)
5 - Make pattern permanent (last ID # specified)
Default =0
Range = 0, 1, 2, 4, 5 (command is ignored for other values)
EN The PCL Print Model 5-45
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). The rectangular
area does not exist and cannot be printed until the Fill Rectangular
Area command (?*c#P) has been issued, even though the
rectangular area has been specified.
Filling a rectangular area does not change the current active cursor
position (CAP). The filled rectangular area is not affected by
end-of-line wrap, perforation skip mode, or margins. A rectangular
area may extend beyond the margins, but it will be clipped to the
printable area of the logical page. Rectangular areas are not affected
by graphics resolution (?*t#R).
Except for the absence of white pixels in the source, pattern
transparency operates the same way for rectangular area fills as for
other sources. The non-white pixels of the pattern are poured through
the entire rectangular area onto the destination. The white bits of the
pattern are either applied or ignored, based on the pattern
transparency mode. If foreground color is used, it is applied to the
non-white bits of the pattern prior to pouring (except for user-defined
color patterns).
Note The Pixel Placement command (?*l#R) affects rules.
The commands used to print rectangular area fills are described
beginning on the next page.
5-46 The PCL Print Model EN
Horizontal Rectangle Size (PCL Units)
This command specifies the horizontal rectangle size in PCL Units.
? * c # A
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. Power-up and reset return this value to
the default.
Horizontal Rectangle Size (Decipoints)
This command specifies the horizontal rectangle size in decipoints.
? * c # H
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.
Decipoints are converted into printer dot values, and any fraction of a
dot is rounded up to the next full dot size.
The default rectangle size is 0. Power-up and reset return this value to
the default.
# = number of PCL Units (valid to 4 decimal places)
# = number of decipoints (valid to 4 decimal places)
EN The PCL Print Model 5-47
Vertical Rectangle Size (PCL Units)
This command specifies the vertical rectangle size in PCL Units.
? * c # B
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.
Vertical Rectangle Size (Decipoints)
This command specifies the vertical rectangle size in decipoints.
? * c # V
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.
Decipoints are converted into printer dot values, and any fraction of a
dot is rounded up to the next full printable dot.
The default rectangle size is 0. Power-up and reset return this value to
the default.
# = number of PCL Units (valid to 4 decimal places)
# = number of decipoints (valid to 4 decimal places)
5-48 The PCL Print Model EN
Fill Rectangular Area
The Fill Rectangular Area command determines the type of pattern
used to fill the rectangle.
? * c # P
Note If a foreground color is selected, solid, shaded, and cross-hatch
patterns are printed in the foreground color. User-defined patterns are
not affected by the foreground color, but can contain color if they are
defined as such. Solid white fills are not affected by foreground color.
Black fill—fills the rectangular area with black fill or with the current
foreground color.
White fill—erases any fill in the rectangular area (it fills the
rectangular area with white fill). Pertaining to white fills, the pattern
transparency mode is always “opaque” (that is, the white pixels
always have an effect on the destination).
Shaded fill—fills the rectangular area with one of eight shading
patterns as specified by the Pattern ID command.
Cross-Hatch fill—fills the rectangular area with one of the six
cross-hatched patterns as specified by the Pattern ID command.
User-defined fill—fills the rectangular area with custom pattern data
as specified by the Pattern ID command and downloaded by the
User-Defined Pattern command.
Current Pattern—fills the rectangular area with the current pattern.
# = 0 - Solid black or foreground color
1 - Solid white fill
2 - Shaded fill
3 - Cross-hatch fill
4 - User-defined pattern fill
5 - Current pattern fill
Default =0
Range = 0 - 5 (out-of-range values are ignored)
EN The PCL Print Model 5-49
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.
Black fill (value field 0), also known as black rule, and the white fill
(value field of 1) “patterns” do not have a choice of different patterns,
and thus do not require a pattern specification using the Pattern ID
command.
The upper left corner of the rectangular area is located at the cursor
position when printing a rectangular area. After printing the
rectangular area the cursor is returned to the upper left corner; the
cursor position does not change positions as a result of printing a
rectangular area.
Rectangular areas are independent of the text area and perforation
skip mode; these boundaries are ignored (rectangles are not clipped
at these boundaries). Addressable rectangular areas are limited to
the logical page. Rectangular areas that extend outside the logical
page are clipped at the logical page boundaries (refer to the PCL 5
Printer Language Technical Reference Manual for logical page and
printable area boundary specifications).
The pattern transparency mode controls how the area fill pattern is
applied to the page. Refer to the following section for a description of
how the pattern transparency mode affects the rectangular fill area.
A white fill “erases” any data placed within the rectangular area,
regardless of the transparency mode settings. However, after a white
fill erases data within an area, data subsequently placed within that
area will be visible.
5-50 The PCL Print Model EN
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).
When applying a pattern (area fill) to the rectangular area, the pattern
transparency mode affects the final result the same as it does when
filling other images or text. The pattern transparency mode
determines the effect white pixels of the pattern have on the
destination for value fields 0 (black fill), 2 (shaded fill), 3 (cross-hatch
fill), or 5 (current pattern fill) of the Fill Rectangular Area command.
The “0'' bits of the fill pattern are either applied (opaque) or ignored
(transparent) based on the transparency mode setting (see
Figure 5-12). When a value field of 1 (white fill) is used, pattern
transparency mode is always treated as if it were opaque.
The effect of transparency modes on rectangular areas is illustrated
in Figure 5-12. In both examples, the source transparency mode is
opaque regardless of the actual setting. In the first example, the
pattern transparency mode is transparent; the white pixels in the
pattern are not applied to the destination, so that the pattern is visible
in only two quadrants of the destination. In the second example, the
pattern transparency mode is opaque, and the pattern is visible in the
entire rectangular area.
EN The PCL Print Model 5-51
Figure 5-12 Effect of Transparency Modes on Rectangular Areas
This example is a monochrome example and assumes the default ROP.
5-52 The PCL Print Model EN
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.
1Position the cursor:
2Specify the width of the rule:
3Specify the height of the rule:
4Print the rule:
5Position the cursor inside the rectangular area:
6Specify the width and height for the smaller white fill rectangular
area:
?*p300x400Y This moves the cursor to PCL Unit
position (300, 400) within the PCL
coordinate system.
?*c900A This sets the rule width to 900 PCL Units
(3 inches at 300 units-per-inch).
?*c1500B This sets the rule height to 1500 PCL
Units (5 inches at 300 units-per-inch).
?*c0P This example prints a black filled
rectangular area.
?*p600x700Y
?*c300a600B
EN The PCL Print Model 5-53
7Select the white fill and print.
Figure 5-13 Solid Fill Example
?*c1P
5-54 The PCL Print Model EN
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.
1Position the cursor:
2Specify the width of the rectangle:
3Specify the height of the rectangle:
4Specify the Pattern ID:
?*p300x400Y This moves the cursor to PCL Unit
position (300, 400) within the PCL
coordinate system.
?*c900A This sets the rectangle width to 900 PCL
Units (3 inches at 300 units-per-inch).
?*c1500B This sets the rectangle to 1500 PCL Units
(5 inches at 300 units-per-inch).
?*c25G This sets the Pattern ID to 25.
EN The PCL Print Model 5-55
5Print the rectangular shaded area:
Figure 5-14 Shaded Fill Example
?*c2P This example prints the following:
5-56 The PCL Print Model EN
EN Raster Graphics 6-1
6Raster 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. While some pictures could be produced using either
vector or raster graphics, raster graphics is best suited for printing
photographic images.
A raster image is invariably rectangular and divided into a gridwork of
pixels. Each pixel represents a small area of the image. In
monochrome images each pixel represents a black or white dot. In
color images each pixel is a colored dot. Therefore, the most
important characteristics of an image are its:
Image width
Image height
Image resolution (the number of dots or pixels per inch)
An image is also divided into rows, where a row is a grouping of all
the pixels in a horizontal strip of the image, the width of the image and
one pixel high.
As noted before, a pixel represents a small area of the image. The
size of the area depends on the resolution of the image. The pixel
area for a 600 dot per inch (dpi) image is a square 1/600th of a inch
on a side. Courser resolutions cover more picture area per pixel. For
example, a 75 dpi pixel contains 0.0002 square inches, a 600 dpi
pixel contains 0.000003 square inches. Some printing and scanning
devices specify a resolution in the horizontal direction and another
resolution in the vertical direction, 300 by 600 dpi, for example.
However, PCL raster only supports identical resolutions in the
horizontal and vertical directions, and therefore, PCL 5 raster
graphics pixels are squares.
6-2 Raster Graphics EN
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. Smaller
pixels give good print quality but larger image size. As a rule, 150 dpi
provides a happy medium of good print quality at a relatively small
image size.
A printer has a printing resolution, 600 dpi for example. An image with
an image resolution smaller than the printer's resolution will undergo
a process of scaling as the image is converted to the printer's
resolution, also known as device resolution. For example, a 150 dpi
image is converted to a 600 dpi image at device resolution by
replicating each pixel four times in the horizontal direction and four
times in the vertical direction. Therefore, a single pixel of a 150 dpi
image is replicated by creating 15 new pixels. A 75 dpi pixel is
replicated by creating 63 new pixels.
The large scale replication of pixels for low resolution images is one of
the main reasons for poor print quality: first the image detail may be
missing from the image because of the large pixel size, and second a
blocky, pixelated effect occurs when the pixel is reproduced over and
over again. Various techniques have been devised to compensate for
this pixelated effect. For example, rather than copy or replicate the
pixel, a bi-linear or bi-cubic interpolation algorithm could be used to
smooth out the transitions by considering the surrounding pixels when
making new pixels. However, this tends to blur edges or sharp
transitions that are in the original image. As a rule, better print quality
results from higher resolution images, such as 150 or 300 dpi, that
use smaller pixels and cause less pixel replication.
Pixels represent specific spots within the picture. In a black and white
image, where a pixel is either black or transparent (white), a single
binary digit or bit can represent a pixel. This has been the standard
raster format for many years. See Figure 6-2 for an example.
However, in color images, or grayscale images, those with varying
black dot sizes which yield a range of grays when viewed by the
human eye, a single bit is not sufficient. Therefore, the general form of
a pixel is:
The number of components in the pixel, which is generally
either one or three, and
The number of bits per component.
EN Raster Graphics 6-3
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.
Image Type Number of
Components Bits per
Component
Black and White, direct 1 1
Black and White, indexed 1 1
Color, indexed 1 8
Color, direct 3 8
6-4 Raster Graphics EN
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. If the color image is 600 dpi, 24-bit color, its
size is 86 Mbytes. Therefore, the PCL 5 language supports several
compressions modes that exploit redundancy between adjacent
pixels or adjacent rows. Furthermore, several shortcuts are available
to avoid sending data that is really large blocks of zeros.
Figure 6-1 Raster Area
EN Raster Graphics 6-5
An images 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:
1The Y Offset command can be used to direct the printer to set all
the pixel values in the given number of rows to zero.
2If not enough data is sent for all the pixels in a row, the remaining
pixels are set to zero.
3If the image is ended before all rows have been received, the
values of the pixels in the remaining rows will be set to zero.
Furthermore, if too much data is sent the data extending outside the
raster area is clipped and discarded.
6-6 Raster Graphics EN
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.
Hewlett-Packard strongly recommends that developers use this
command sequence in their applications.
Note Although the source raster height and width commands are not
necessary, they improve memory efficiency.
Well-Behaved Raster Command Sequence
Raster Presentation
Raster Resolution
Raster Height
Raster Width
Start Raster Graphics
Y Offset
Raster Compression
Transfer Raster Data
Transfer Raster Data
Y Offset
Transfer Raster Data
Y Offset
Raster Compression
Transfer Raster Data
Raster Compression
Transfer Raster Data
End Raster Graphics
EN Raster Graphics 6-7
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. Once specified, the
printer remains in that mode unless explicitly changed by issuing the
command again, or reset to default values by a soft reset, self test,
font printout, or power cycle.
Note Only raster data appearing within the intersection of the logical page,
the printable area, the raster width, and height is printed. If raster
width and/or raster height have not been set, the intersection of the
logical page and the printable area determines where raster graphics
appear; raster data is clipped to the printable area.
6-8 Raster Graphics EN
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
This command must be sent prior to the start graphics command. The
factory default resolution is 75 dots-per-inch.
Note Lower resolution graphics occupy less user memory. For example, the
number of bits required to represent a two-inch by three-inch image at
75 dots-per-inch is 33,750. The same image at 300 dots-per-inch
requires 540,000 bits. Note that lower resolution graphics may not
give acceptable print quality.
When configured for 300 dpi resolution, the printer automatically
expands raster graphics transferred at resolutions less than
300 dots-per-inch to 300 dots-per-inch during printing. Figure 6-2
illustrates how a single bit is translated into the corresponding printed
dots in various graphics resolutions when the printer is configured for
300 dpi.
# = 75 - 75 dots-per-inch
100 - 100 dots-per-inch
200 - 200 dots-per-inch
150 - 150 dots-per-inch
300 - 300 dots-per-inch
600 - 600 dots-per-inch
Default =75
Range = 75, 100, 150, 200, 300, 600
EN Raster Graphics 6-9
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.
6-10 Raster Graphics EN
Raster Graphics Presentation Mode Command
The Raster Graphics Presentation command specifies the orientation
of the raster image on the logical page.
? * r # F
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.)
A value of 3 indicates that the raster graphics will be printed
along the width of the physical page, regardless of logical page
orientation. In portrait orientation, a raster row is printed in the
positive X-direction of the PCL coordinate system and a
subsequent raster row is printed beginning at the next dot row
position in the positive Y-direction. In landscape orientation, a
raster row is printed in the positive Y-direction of the PCL
coordinate system and a subsequent raster row is printed
beginning at the next dot row position in the negative
X-direction. Figures 6-3 and 6-4 illustrate presentation modes
0 and 3.
# = 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
EN Raster Graphics 6-11
Figure 6-3 Raster Graphics Presentation Mode for Portrait Orientation
Raster
Presentation
Mode
Orientation 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
6-12 Raster Graphics EN
Figure 6-4 Raster Graphics Presentation Mode for Landscape Orientation
EN Raster Graphics 6-13
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
* Greater values default to (logical page length - current Y cursor position).
Note Specifying the raster width and raster height improves memory
usage. Therefore it is highly recommended.
This command fills the raster area to the full raster height with zeroed
rows. Unspecified rows map to either white or transparent depending
on the source transparency mode (this is true only if index 0 is white).
When a Transfer Raster Data command is received that causes any
raster row to extend beyond the row boundary set by the Raster
Height command, the row outside the boundary is clipped. This
includes the case where the cursor is moved beyond the height
boundary with a Raster Y Offset command and the printing of raster
data is attempted.
If you have specified either a raster height or a raster width of 0 and a
Start Raster Graphics (or Transfer Raster Data) command is
received, then the entire raster graphic is clipped. If both a raster
height and a raster width are specified (non-zero) and a Start Raster
Graphics (or Transfer Raster Data) command is received, then the
raster area is guaranteed to be filled.
Note For color printers, a zero fill is not necessarily white.
If the raster height is not set, no padding or clipping of rows takes
place.
# = Height in raster rows
Default =N/A
Range = 0 to (logical page length – current Y- position of the 0,
cursor)*
6-14 Raster Graphics EN
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.
Figure 6-5 Maximum Raster Height
EN Raster Graphics 6-15
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).
? * r # S
* Greater values default to the (logical page width – left graphics margin).
Note Specifying the raster width and raster height improves memory
usage. Therefore it is highly recommended.
This command allows you to implicitly tell the printer to pad raster
rows that are not specified for the full raster width with zeros.
Unspecified data maps to either white or transparent depending on
the source transparency mode (this is true only if index 0 is white).
Note For color printers, a zero fill is not necessarily white.
When a Transfer Raster Data command is received that specifies a
row of data that is longer than the raster width, the data that extends
beyond the raster width is clipped.
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.
# = Width in pixels of the specified resolution
Default = depends on raster presentation mode: when
presentation mode is 0 then width = width of logical
page minus left graphics margin; when presentation
mode is 3 then width = dimension of logical page along
paper length minus left graphics margin.
Range = 0 to (logical page width minus left graphics margin)*
6-16 Raster Graphics EN
Figure 6-6 Maximum Raster Width
EN Raster Graphics 6-17
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
A value of 0 specifies that the left graphics margin is at the default left
margin of the page (X-position 0). A value of 1 specifies that the left
graphics margin is at the current X-position. Values of 2 or 3 are
equivalent to 0 and 1, but also enable resolution-independent scaling.
In presentation mode 3, the location of the left graphics margin varies
depending on the orientation.
Once a Start Raster Graphics command is received by the printer,
raster graphics resolution, raster graphics presentation mode, raster
height, raster width, and left raster graphics margin are fixed until an
end raster graphics command is received.
Once in Raster Graphics Mode, PCL commands and text imply an
End Raster Graphics (?*rC) except for the following commands:
Transfer Raster Data by Row or by Plane
Set Raster Compression Method
Raster Y Offset
In addition, the following commands are ignored (i.e., locked out)
while in Raster Graphics Mode and do not imply an End Raster
Graphics command:
Start Raster Graphics
Set Raster Width
Set Raster Height
Set Raster Presentation Mode
# = 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.
Default =0
Range = 0 - 3 (out-of-range values default to 0)
6-18 Raster Graphics EN
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.
EN Raster Graphics 6-19
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
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.
For Delta Row compression (method 3), this command zeros the
seed row. For Adaptive compression (method 5), this command
applies to the entire raster data block.
Note Movement by this command is based upon the Raster Resolution
setting (?*t#R) and also the printer's resolution setting (75, 150, or
300 dpi).
# = Number of raster lines of vertical movement
Default =N/A
Range = 0 - 32767
6-20 Raster Graphics EN
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.
While PCL 5 compression methods are based on redundancies at the
byte level, the pixel encoding mode must be considered when
choosing a compression method. The direct by pixel mode transfers
the three bytes which make up a pixel, one after the other. Therefore,
compression formats that depend upon reducing redundancy within a
row will not do well, since the pixel to pixel redundancy is disguised by
the format. This is because, while two adjacent pixels have a fairly
high probability of being identical, the probability that the components
of a pixel are identical is very small. For example, consider a raster
image whose background is all one color. While there are a large
number of pixels that are identical, the only time the bytes within the
pixel will be identical are if the color is a gray somewhere between
white and black: such as (0, 0, 0), (128, 128, 128), (255, 255, 255). If
the pixel represents a non-gray color, the bytes within the pixel will not
be identical. Therefore, the only successful compression mode that
exploits redundancy between the rows is delta row compression.
Since the probability that a pixel is the same in the horizontal direction
is usually equivalent to the probability that it is the same in the vertical
direction, the bytes within a pixel will be redundant and therefore
compressible from row to row.
The remaining pixel encoding modes: index by plane, index by pixel,
and direct by plane, can be redundant within a row and are, therefore,
compressed well by compression methods such as run-length
encoding, and TIFF rev 4.0.
EN Raster Graphics 6-21
The Set Compression Mode command has the following form:
? * b # M
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 first
byte of each pair is the repetition count for the data in the second
byte. The second byte is the raster data to be printed. A repetition
count of 0 signifies the pattern in the data byte is not repeated (it
occurs only once). A repetition count of 1 signifies the pattern occurs
twice. The repetition count can range from 0 to 255 for a repetition of
1 to 256 times.
[(Repetition count byte 0-255)(pattern byte)] . [ . ] [ ]
Tagged Image File Format Encoding
(Method 2)
Tagged Image File Format encoding interprets raster data as TIFF
“Packbits.” This format combines features of methods 0 and 1. A
control byte precedes the raster data (pattern bytes). The control
byte identifies whether the pattern byte(s) represent a byte that is to
be repeated some number of times (up to 127), or represent some
number of bytes (up to 127) which are to be printed as is (literally).
# = 0 - Unencoded
1 - Run-length encoding
2 - Tagged Imaged File Format (TIFF) rev. 4.0
3 - Delta row compression
5 - Adaptive compression
Default =0
Range = 0 - 3, 5 (other values are ignored)
6-22 Raster Graphics EN
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. A pattern byte may be repeated up to 127 times; or up
to 127 literal bytes may follow the control byte.
As mentioned, for a byte to be repeated, the control byte must be a
negative value as represented by the twos complement. For example,
to repeat a pattern three times would require the twos complement of
the number 3. The twos complement is computed as follows. The
binary of 3 is 00000011. Complement each bit to get 11111100, then
add one to this value to produce 11111101, the twos complement.
The decimal value of this number, 253, used in the control byte,
produces a repetition of 3 bytes for a total of 4 occurrences of the
pattern.
The range of numbers for the control byte is shown below.
Literal Pattern Values
# of Bytes Binary value Decimal value
1
to
127
0000 0000
to
0111 1111
1
to
127
No Operation Value
NOP value Binary value Decimal value
128 (-128) 1000 0000 128
Repeated Pattern
Values
# of Repetitions Binary value* Decimal value
1 (-1)
to
127 (-127)
1111 1111
to
1000 0001
255
to
129
* These negative values are represented by taking the twos complement of the value
of the number.
EN Raster Graphics 6-23
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.
For example, a control byte of 0 means the following 1 byte is literal
raster data. A control byte of 6 indicates that the following 7 bytes are
literal raster data bytes.
TIFF encoding also allows you to include a non-operative (NOP)
control byte, represented by the value -128. This byte is ignored, and
the subsequent byte is treated as the new control byte.
Note It is more efficient to code two consecutive identical bytes as a
repeated byte. If these bytes are preceded and followed by literal
bytes, however, it is more efficient to code the entire group as literal
bytes.
Examples: Run-length and TIFF Compression
The following examples show how a raster row can be coded using
run-length and TIFF compression methods. Note that the
compression examples use characters to represent the binary data
stream.
Unencoded
?*r1A
?*b0m7WUUUUATT
?*rC
Byte
Number #1 #2 #3 #4 #5 #6 #7
Bits 01010101 01010101 01010101 01010101 01000001 01010100 01010100
ASCIIUUUUATT
6-24 Raster Graphics EN
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 raster data (pattern)
bytes are represented by the ASCII character.
Delta Row Compression (Method 3)
Delta row compression identifies a section of bytes in a row that is
different from the preceding row, and then transmits only that data
that is different (the delta data). If a row is completely different from its
preceding row, then the entire row must be sent as the delta, which is
not very efficient; if only one bit is different, then only one byte is
identified and sent. To reassemble the raster data rows, the printer
takes the current row (the seed row) and makes the changes
indicated by the delta data, to create the new row. The new row
(which becomes the new seed row) is used by the next delta
compression data to create another row.
A delta compression row consists of two parts, a command byte and
the replacement bytes, as shown below:
[(Command byte)(1 to 8 Replacement bytes)]
EN Raster Graphics 6-25
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.
If more than eight replacement (delta) bytes are needed, additional
command byte/replacement bytes may be added, as shown below:
?*3m#W [(Command Byte)(1 to 8 Replacement
Bytes)][(Command Byte)(1 to 8 Replacement Bytes)]. . .
In the command byte, the upper three bits identify the number of
replacement (delta) bytes (which can be 1 to 8 bytes). The lower five
bits identify the location the replacement bytes are to be positioned.
This position is identified as the offset, or the number of bytes from
the treated byte. For example, if there are 5 replacement bytes and
the offset is 7, then the replacement bytes replace bytes 7, 8, 9, 10,
and 11 (the five bytes beginning at byte 7 from the seed row).
If there is more than one replacement in a row, the second offset is
counted from the next untreated byte in the row: the first byte
following the last replacement byte.
7 5 4 0
Number of bytes to replace (1-8) Relative offset from last untreated
byte
6-26 Raster Graphics EN
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.
Also, if this second offset byte is set to 255 (all ones),
additional offset bytes follow until the required offset value is
obtained. When the formatter detects an offset byte less than
255, it is assumed to be the last offset value and the offset
bytes are then totaled (added). The following example shows
an offset larger than 31:
The total offset is 414, which is the sum of the three offset values:
31 + 255 + 128.
Seed Row
The seed row is basically the current raster data row, the row being
printed. It is maintained by the printer for use by delta row
compression. The delta compression replacement bytes are applied
to the seed row to create the new row. This new data row is printed
and becomes the new seed row.
For color raster images, the printer operates on each plane
independently, and a separate seed plane is maintained for each
graphic plane. A Y offset, however, affects all planes and seed rows
simultaneously.
EN Raster Graphics 6-27
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.
Printing A Zeroed Row (Setting the Seed Row to Zero)
?* b 1 Y
It is possible to print a row of all zeros using the Raster Y-Offset
command. Sending a Raster Y Offset command with a value field of 1
sets the seed row to zero and prints the zeroed row. Note that the
next delta row is applied to a zeroed seed row.
Other cursor position moves set the seed row to zeros. (Remember,
non-graphic cursor moves have the same effect as an end graphics
command.)
Note If the byte count of the Transfer Raster Data command value field is
less than the number of bytes that can be replaced, the byte count
has precedence. Also, if the last byte is a control byte, it is ignored.
Therefore, ?*b1W does not affect the seed row, but causes the
previous row to be replicated.
Example: Delta Row Compression
The following example demonstrates how to compress the following
data using the delta row compression. (The bytes highlighted in bold
type indicate those bytes needing replacement – those bytes that are
different from the previous row, the seed row.)
Byte No. 0 1 2 3 4
Row 1 00000000 11111111 00000000 00000000 00000000
Row 2 00000000 11111111 11110000 00000000 00000000
6-28 Raster Graphics EN
?*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
curre