views:

147

answers:

2

How to convert an large image and embed it into postscript?

I used to convert the bitmap into HEX codes and render with colorimage. It works for small icons but I hit a /limitcheck error in ghostscript when I try to embed little larger images. It seem there is a memory limit for bitmap in ghostscript.

I am looking a solution which can run without 3rd party/pre-processing other then ghostscript itself.

+2  A: 

Convert from ImageMagick reads the encoded image data line by line it seems. Try it on an example image and read the PS output.

lhf
I'd like to implement the logic myself, not depending on 3rd party. So, did you suggest me to read the source code of Convert?
Dennis Cheung
No, look at what Convert generates.
lhf
I am not interested to what it generated, but HOW it generate.
Dennis Cheung
I meant, look at the PS code output by Convert. You'll probably be able to figure out how it does what it does and then use it yourself.
lhf
+1  A: 

The freeware vector graphics program InkScape will convert your bitmap into easily understandable code embedded with the converted graphic.

We recently had a problem where we were sending postscript code from our mainframe to a printer. We tried converting it with ImageMagik and got the result to work in GhostScript but the mainframe language we use had mainframe to printer transmission problems with the code. The InkScape conversion was much simpler, much more basic and we were able to easily identify and remove the extemporaneous code. What had been a 2 month struggle with the graphic from the ImageMagik converter was resolved in 3 hours with the new InkScape graphic.

I think that you will be happy with the results from InkScape, regardless of whether you want to convert an image or have an example of some simple working Postscript graphics. Also, if you are building a converter, InkScape is open source!

Shadeclan