Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations SkipVought on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

PCL Color Problem

Status
Not open for further replies.

Tobias1983

Programmer
Aug 19, 2009
8
0
0
DE
Hi everybody,

i have an problem with PCL Commands.
I try to print an 24Bit RGB Image with PCL.
But i don't know why it doesn't work.

Here my commands.

Start with RESET and PCL init

1. // Set 24bit RGB color
Command : \x1B*r3U
2. // the set Raster presenation
Command : \x1B*r0F
3. // set resolution
Command : \x1B*t300R
4. // Height for the Image == 30pxl
Command : \x1B*r30T
5. // Widthfor the Image == 30pxl
Command : \x1B*r30S
6. // Now Start the Grafik
Command : \x1B*r1A
7. // Set Data Format(RGB, 8bit for each Color)
Command : \x1B*v6W\x0\x3\x0\x8\x8\x8
8. // then Set compression off
Command : \x1B*b0M
9. // now i will send the data
// repeat the command for height=30 times
Command : \x1B*b90W 30 x (#r7-0#g7-0#b7-0) ...
10. after this i stop raster graphic
Command : \x1B*rC

the reset commands

now the printer prints right width and height.
but the wrong colors. only red and black not the RGB colors.

but why ???

I Hope someboy can help me.

Thanks for reply.
Tobias
 
The following (annotated) PCL should print a small rectangle containing red, green and blue columns, although (as I'm now retired and have no access to a colour LaserJet) I can't be absolutely sure of this.

Where sequences include binary (non ASCII) bytes, these are shown in hexadecimal format within [ ] delimiters.

I've set the raster resolution to 75 dpi in order to make the rectangle a reasonable size.

I've also omitted all but the first and last of the 30 'raster row' sequences for brevity.

I've left in the 'simple colour' palette selection, although (as the raster image uses 'direct pixel' encoding) this is superfluous.


Code:
Sequence          Data / Interpretation
¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯  ¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯
<Esc>E            Printer Reset
<Esc>&u600D       Unit-of-Measure (PCL units per inch)
<Esc>&l26A        Page Size: A4
<Esc>*p1200x      Cursor Position (PCL units): Horizontal
       1800Y      Cursor Position (PCL units): Vertical
<Esc>*r3U         Simple Colour: 3-Plane RGB Palette
<Esc>*r0F         Raster Graphics Presentation: Logical
<Esc>*t75R        Raster Graphics Resolution (dots per inch)
<Esc>*r30T        Raster Height (raster rows): Source
<Esc>*r30S        Raster Width (pixels): Source
<Esc>*r1A         Start Raster Graphics: Left Margin at X
<Esc>*v6W         Configure Image Data
[ 6 bytes ]       [ 00 03 00 08 08 08 ]
<Esc>*b0M         Set Compression Mode: Unencoded
<Esc>*b90W        Transfer Raster Data (Row/Block)
[ 90 bytes ]      [ ff 00 00 ff 00 00 ff 00 00 ff 00 00 ff 00 00 ff ]
                  [ 00 00 ff 00 00 ff 00 00 ff 00 00 ff 00 00 00 ff ]
                  [ 00 00 ff 00 00 ff 00 00 ff 00 00 ff 00 00 ff 00 ]
                  [ 00 ff 00 00 ff 00 00 ff 00 00 ff 00 00 00 ff 00 ]
                  [ 00 ff 00 00 ff 00 00 ff 00 00 ff 00 00 ff 00 00 ]
                  [ ff 00 00 ff 00 00 ff 00 00 ff ]
. . .
. . .             Comment - raster data sequence repeated 30 times in all
. . .
<Esc>*b90W        Transfer Raster Data (Row/Block)
[ 90 bytes ]      [ ff 00 00 ff 00 00 ff 00 00 ff 00 00 ff 00 00 ff ]
                  [ 00 00 ff 00 00 ff 00 00 ff 00 00 ff 00 00 00 ff ]
                  [ 00 00 ff 00 00 ff 00 00 ff 00 00 ff 00 00 ff 00 ]
                  [ 00 ff 00 00 ff 00 00 ff 00 00 ff 00 00 00 ff 00 ]
                  [ 00 ff 00 00 ff 00 00 ff 00 00 ff 00 00 ff 00 00 ]
                  [ ff 00 00 ff 00 00 ff 00 00 ff ]
<Esc>*rC          End Raster Graphics
<Esc>E            Printer Reset
 
Hi,

thanks for your anwser.
I tried your example.
But i've got the same Problem.
He prints Red Black Red.

It's exactly the same Result.

Have you an another Idea ?

But really thanks.

Tobias
 
What happens if you move the Configure Image data command in Line 7 so it precedes the raster start in Line 6?

I always use a CMY palette myself in PCL. Ink and RGB don't mix well in my head.

Jim Asman
 
hi,

i think the problem is i use the printer "hp deskjet 5150" and he can't use pcl 5.
But one thing i don't understand, i thought these command i used are pcl 3 ...

Thanks everbody.

Tobias
 
AFAIK, No!

The Configure Image Data Command is PCL5c. End of story.

A PCL5c printer can dither the image, so you can send 24 bit data to it directly. A PCL3 printer will require a dithered image in 3 separate planes.

Jim Asman
 
Damn....

ok thx really,

one last question.
when i transfer the data bytes by plane, can i use RGB or only CMYK ??

Tobias
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top