[Tex/LaTex] Convert eps figure to grayscale without removing white space around the figure

conversionepsgraphics

I use eps2eps command followed by pscol command which convert color eps to grayscale. But this combination remove white space around the figure (which is probably done by eps2eps command). Directly applying pscol on my original figure without eps2eps before does not work.

How to convert eps color figure into gray scale to have the same white space around?

Best Answer

The white space around images stored in eps format is controlled by the bounding box and high resolution bounding box definitions, which appear near the top of the file, and look like this.

%%BoundingBox: 1 0 388 327
%%HiResBoundingBox: 1.100000 0.800000 387.249609 326.700000

For a small number of images, you can just open the files with a text editor and replace the bounding box definitions in the version produced by eps2eps with the definitions from the old file. Sometimes the high resolution bounding box will be absent, in which case just ignore this part and restore the bounding box to its original form.