How to reduce the size of .eps file

Hi all,

I have a graph produced by GMT plot with .eps format. But the size is very large of about 21 MB. Could you give some advice about how to reduce that size? With some commands in the script or use some apps outside to reduce the size? Many thanks.

PS file size is completely data dependent (21 Mb is not even big) and not much you can do except down-sample your data. Use PDF that compresses the fig file.

Thanks Joaquim, But the Adobe illustrator can not open that big size 21Mb for the further processing. Yep, Adobe Acrobat could reduce the size of eps file. Thanks again.

Are you plotting a large raster file with grdimage or a vector dataset including a large number of points or lines with psxy? The raster images can be downsized by Adobe Acrobat, but Acrobat or Illustrator will not be able to do much with a large vector database graph.

Thanks EJFielding. I used psxy to plot a large number of points and lines with multiple sub graphs in one graph. So it seems no other methods to solve this problem? Cheers.

One option, if you are plotting a large number of points and lines, is to use the GMT psconvert program to convert the EPS file to a raster format that you can then load into Illustrator. This won’t allow you to edit any of the features in the plot, but you can add annotation on top of the raster image.

I have opened PS files in Illustrator that are hundreds of Mb so I do not understand on what planet 21 Mb is big. It is 21 Mb because you have lots of detail in your data. You can either dumb down the data before plotting, or you can use PDF as your vector format. Both will shrink the file. Or, as Eric suggest, you use a raster format. My suggestion would be to use PDF since it will preserve your information exactly - nobody cares about EPS files anymore.

Thanks for suggestions EJfielding. But the graph needs to be edited by AI further. The annotation edit is not enough. Thanks again.

Thanks pwessel. I tried ‘psconvert -Tf *.ps’ in the command line to get the PDF format. But the size was changed from 21 MB to 130 MB. Is that normal? Or should I use that command in the script?

That is not normal. Are you sure *.ps only got one file? I have never seen a PDF increase its size relative to the PS so something is not right here.

Yep. I checked the script and plotted the image again. There were four outputs with option ‘-TGef’. The size of eps, ps, pdf, png is 19MB, 19MB, 56MB, 1.4MB repectively.

I would be curious to have a look at your PS file if you can zip it up and post it somewhere.

Thanks for your concerning. But the graphs has not been published yet. I will upload one graph in near future. Cheers.