I would like to be able to import an EPS file in to LaTeX while using some 3rd party image viewer/editor to quickly find crop coordinates. What are some good free tools for this? GIMP (the GNU Image Manipulation Program) is a free program that works on all major platforms, but it is not a vector graphics editor; will it work? It appears that you can choose any resolution with GIMP when you import. Additionally, since an EPS file is a vector graphics file, are there native units that LaTeX will recognize?
[Tex/LaTex] a good workflow for importing and cropping EPS images
epsgraphicsworkflow
Best Answer
Method A: Dealing directly with PostScript
Since you're dealing with PostScript images, one option might be to use GhostView; I've done so successfully in the past. As an example, consider
tiger.eps
.Open
tiger.eps
using GhostView.Show the bounding box if you wish to see the extent of the existing whitespace:
Position the cursor on to identify the left, bottom, right and top coordinates. In my example, these are l b r t = 15 175 564 743.
Open
tiger.eps
and find the lines starting with%%BoundingBox
in the "preamble":Update this to incorporate the new bounding box:
There may also be a
%%HiResBoundingBox
entry, which you can update accordingly.Refresh the view in GhostView which now shows the cropped bounding box:
Include as usual via
\includegraphics
, since the bounding box has been permanently updated. If you don't want to update the EPS permanently, you can also usein your document.
Method B: Cropping via PDF
Use the command-line conversion
which produces
tiger.pdf
.Use
pdfcrop
which produces
tiger-crop.pdf
.Convert back to EPS using
to overwrite
tiger.eps
with a now-cropped version:New bounding box resembles
which is marginally different to the manual way described in Method A (which yielded a width of 564 - 15 = 549; height of 743 - 175 = 568).