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 strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Raster Data

Status
Not open for further replies.

srwatson

Programmer
Dec 13, 2011
16
CA
I have a small PCL file (Google's logo) that I've converted to PCL. The structure of the PCL is below. I've been able to get the image to print out correctly to a Kyocera FS-4020DN, SHARP MX-M503N, and one other printer that I don't currently have access to. When I print this Image to a HP Photosmart D110, a HP LaserJet home, and HP LaserJet office printer the image is mostly black.

Code:
*r#S
*t#R
*v6W
*r1A
*b0M
*b#W
*b#W
*b#W
*rC

I looked through the PCL5 comparison guide and noticed the 'configure image data' command isn't support on many of the LaserJet printers. So, I tired removing the configure image data command to try and print a monochrome raster image (As mentioned in the HP RTL guide). The effect was the same.

Code:
*r#S
*t#R
*r1A
*b0M
*b#W
*b#W
*b#W
*rC

- Thanks
 
>> When I print this Image to a HP Photosmart D110, a HP LaserJet home, and HP LaserJet office
>> printer the image is mostly black

Possibly because (as you've surmised) these printers do not support the CID mechanism; some may not even support PCL5.

... and just removing the CID sequence doesn't necessarily turn the image into a monochrome image.

We'd need to see samples of your generated PCL files (including the # values and the (#-number of) binary bytes following those sequences, in order to begin to advise.

You can attach sample files to posts via the MediaFire file storage mechanism.
 
How do raster images work on non CID supporting printers?

Would you mind if I emailed you the PCL file? All file sharing websites are blocked.
 
Further, if you are printing the color file to a monochrome
printer, the image must first be converted to grayscale and then
"dithered" to a halftone similar to a newspaper image that only contains BW pixels.

As it is, your image will probably only print correctly on a PCL5c color printer.


Jim Asman
 
Jim is far more experienced than I am as regards raster images, so (as you don't have access to file sharing websites) it would be better to send a sample file to him (contact details via his website), although he's already provided a (very) probable reason for your symptoms.
 
In this PCL context, you are looking at either PCL5c that you are using now where you just send all 24bits per pixel to the printer raw, and the printer does the necessary dithering etc. so you end up with a reasonable image.

The Photosmart, I believe, is proprietary to HP and there is no information available as to its requirements.

That leaves us with PCL3 color printers, historically used by the vast majority of PCL inkjet printers. Today of course, many of the new printers don't speak PCL at all.

Where a PCL5c printer, as per the CID specs accepts the raster data in a single plane as such, and converts the pixels to their appropriate CMY values.

A PCL3 printer requires that you separate each of 3 components into invididual planes that when overlaid on top of each other will produce the image. Basically, you derive 3 monochrome images from that color data, dither them for printing, then combine the 3 planes back together, one row at a time, to send to the printer.

Assuming no compression, a single raster row will look like....

<esc>*b150V Data (cyan layer)
<esc>*b150V Data (magenta layer)
<esc>*p150W Data (yellow layer)

Note that the first two planes commands end with a "V" which tells the printer NOT to increment the row. Only when the command ends with the "W" is the row incremented. Then the process repeats until all rows are done and the image is complete.

In the past, I have made an image this way and it prints quite nicely on one printer, but looks terrible when printed on a different. You are basically trying to create a PCL file that is all things to all printers. It's a lot of work.

Of course non HP compatible printers are out of the question.

Jim Asman
 
I'm now using the following format like you suggestion

Code:
<esc>*b150V Data   (cyan layer)
<esc>*b150V Data   (magenta layer)
<esc>*p150W Data   (yellow layer)

I'm seeing the same results. The link to my PCL file can be found below.

 
Sorry, the last PCL file was the wrong one. I linked the PCL file below that I was originally talking about. When I tried splitting the colors into there own commands as showed in my previous post it didn't work for me (I'm assuming that's my own fault) and rendered the file I attached in the previous post.

 
Well, first of all you need to define the color space. Try
<esc>*r3U
for using RGB values.

The CID command is PCL5c ONLY.

Your <esc>*b### commands all state ZERO bytes followed by a bunch of data, effectively garbage.

Do you understand that the dithering process takes the 24 bits per pixel in the original and effectively reduces it to 3 bits in the PCL output. Just reading in the values in the image file is a long way from a printable PCL3 file. You basically divide the original 24 bpp file into three 8 bpp files which are then dithered down to 1 bpp in each.

You need to read up on dithering images. It will take some effort.

I would suggest that you first start out trying to create a printable grayscale image, and once you have that working then project your new found knowledge into printing a color image

Jim Asman
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top