Page 1 of 1

Fast conversion of postscript files

Posted: 2007-02-27T17:07:12-07:00
by hoopz
Okay, I have two questions, but I am basically just trying to figure out the fastest way to do this.

I have a program that I call from my web app that takes some user input and produces an image. This program produces images in postscript format, but since I want them to be displayed on the web I use IM to convert them to jpegs. All I am using is the command:

Code: Select all

convert image.ps image.jpg
Now, the images that are produced are essentially black and white graphs, and the above is working fine when the graphs are of reasonable dimensions. However, sometimes there is a lot of data on the graph and I have to create a larger image file. The default size of the jpeg if I don't change anything is 612x792, but I want to be able to make this say, 10 times larger, without losing quality. I feel like this is something I should be able to do since postscript is vector based, right? But I've tried throwing the -resize option into my convert command and it seems like it is converting to jpeg and then resizing, and the quality is bad. Anyone know of a way to do this without losing quality?

Presently, I am using an option in the program to resize the physical paper size of the postscript file. Normally, the paper size is 20x26 cms, which when converted results in the 612x792 jpeg. If I change the size to 200x260 cms, for example, and then convert, I get a much larger image and it looks beautiful. The only problem in this is that the conversion takes quite awhile in this case. So, my second question is, are there ways to speed up conversion or is there another web viewable file format that I can use that might be faster to convert to?

Any advice would be greatly appreciated, whether it is in response to one of my questions or a different approach I might take. Thanks!

Re: Fast conversion of postscript files

Posted: 2007-02-27T17:36:12-07:00
by anthony
Add a -density setting before reading the postscript. The default density is 72 dpi whcih is 'screen resolution'. for printer quality try 600dpi

You can also use an even higher resolution, then resize the image, to produce a better anti-aliased result.

Re: Fast conversion of postscript files

Posted: 2007-02-27T18:47:35-07:00
by hoopz
Thanks for the tip, but it's not working like I need it to. Here's what I am doing:

Code: Select all

convert image.ps image.jpg
gives me a 612x792 jpeg, but I want something larger but without reduced quality.

So I tried

Code: Select all

convert image.ps -density 600 image.jpg
and it gave me the same as the first.

I tried

Code: Select all

convert image.ps -density 600 -resize 200% image.jpg
and it gave me an image twice the size of the original but with reduced quality.

Re: Fast conversion of postscript files

Posted: 2007-02-27T19:00:05-07:00
by magick
Put -density before the Postscript image filename.