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!

Compression of Raster Data

Status
Not open for further replies.

Tobias1983

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

i have an question to PCL.

i Print an Image an i know these Image have only 2 Colors but RGB color. (BACK == 0x00FF0000, FRONT == 0x000000FF)

Printing the images needs to much time because i Print every pixel as RGB color.

Now my question:
is it possible to Set Foreground as 1 an background color as 0 an then print only bits ?

example : 10 pixel = 11001100 11000000

Thanks for Help Tobias

 
If this is PCL5 color, simply define a 1 BPP pallette that meets your specs.

Otherwise,

first convert your image to a monochrome .BMP

There is a 2 color pallette in the 8 bytes starting at 0x36.
That is 4 bytes each for the foreground and background. I believe the byte order is BGR-. While the image data is RGB, the pallette is BGR. I think the first 4 bytes are the foreground.

The 4th byte is not used. Leave it at 00.

Using a hex editor, change the .BMP to suit.



Jim Asman
 
ok,

i tried this and i can print black and white.

But i didnt found the command for Foreground and Background Color. And with this Command is it possible to set bit 1 to RED and 0 to GREEN ?

Sorry im new in PCL. And i didnt understand some Ports of the Documentation.

Thanks for your Help

Tobias
 
Iam Using an Brother 4040CN.

But i will use an Command that is working with (if possible) every PCL5 Printer.
 
In PCL5 then,

1. Configure Imaga Data (CID) Defines Palette size, type etc.

<esc>*v6W 00 01 01 08 08 08

There are only 6 bytes that follow the W above. Those are hexidecimal pair values shown for a RGB palette


Define palette

<esc>*v###a###b###c0I

<esc>*v###a###b###c1I

In the two commands above, the ### before a, b, and c, define the RGB values respectively. These are decimal with a range from 0 to 255. The number before the I at the end is the index into the palette than the RGB values represent. As we are defining a bi-level file only 0 and 1 are valid.

Finally,

<esc>*r####s####T

where the decimal numerals specify the image width and height. The value before the s is the width.

Follow all this with the raster resolution and monochrome data and you should have your color image.

Jim Asman
 
Hey,

thank you very much.

It works =)

Thanks again.

Greez Tobias
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top