1827245 Members
2237 Online
109716 Solutions
New Discussion

Re: HP-UX library

 
SOLVED
Go to solution

HP-UX library

Does anyone know if there is a library function in HP-UX 11.11 to enable me to print images in gray scale?
6 REPLIES 6
Mark Grant
Honored Contributor

Re: HP-UX library

What do you mean by a library? Do you want to code it yourself, if so, there are a lot of libraries you can use to convert images to grey scale such as Image Magick, gtk, etc etc.

If you only want an existing image to appear as grey scale then you would need support from your printer and it would be an option for the particular printer you had.

If you want to convert images to grey scale in a script and then print it (which may end up being simpler) consider installing ImageMagick
http://imagemagick.sourceforge.net and using the "convert" utility (it's really great!)
Never preceed any demonstration with anything more predictive than "watch this"

Re: HP-UX library

I have colour images stored as blobs in a database that a user wants to bulk print out over night by supplying a list from another application. After getting 2 images from the database I would like to be a print them as greyscale images on 1 page. The images are 100dpi. This functionality exists within Netscape without installing anything else and printing used to exist in ImageView on HPUX 10.20.
Mark Grant
Honored Contributor

Re: HP-UX library

I could be way off here but I believe netscape converts to postscript first and, if you're doing that, it's quite easy to set the image to grey scale.

if you want a correct image grey scale, the standard HP-UX spooler is not up to the job, you need some software in between. In the case you describe, that software is Netscape.

It seems you have two choices, either write a simple script to conver each image using "convert" or "gs" and pass the result to the printer.

Alternatively, install the "cups" printer spooler as not only is it a 100 times better than the HP-UX spooler, it also provides an option to "lp" to print in grey scale!!.
Never preceed any demonstration with anything more predictive than "watch this"

Re: HP-UX library

Is there a simple example of taking a jpeg image and turning it into postscript so that it can be printed. Using the HP ImageView library i can get the image expanded and into a memory buffer, what i am missing is the bit that puts out to the printer.

The 'convert' tool only seems to work for Audio. We are limited to only using HP products.
Mark Grant
Honored Contributor
Solution

Re: HP-UX library

Firstly, the "convert" tool I mentioned is from the ImageMagick software (see my first post) which does all sorts of transformations on jpg images. ImageMagick is free software, you can download it, install it and run.

If I remember correctly (though I might be confusing this with AIX) HP-Ux 10.20 had an "enscript" command to convert images to postscipt. This is not available on HP-UX 11.*.

There are alternatives for converting an image to postscript such as "ghostscript".

However with "convert" from ImageMagick it is as simple as

"convert image.jpg image.ps"

You might even be able to do the whole operation with something like

"convert image.jpg gray:image.ps" though I've not tried that.

Never preceed any demonstration with anything more predictive than "watch this"

Re: HP-UX library

We found a tool called JPEG2PS which does the job. All we need to do now is master postscript.

See www.pdflib.com/products/more/jpeg2ps.html

Thanks for your help