# Clipping a figure to content

Is it possible to clip a figure inserted with \includegraphics to contents? That is, remove all surrounding whitespace.

-
Please, do not forget that when you clip/crop a pdf file containing vector-like data, you do not reduce the size of the file. For instance, if you want to zoom into a big image, the big image will be stored in your final file even though a small portion only will be visible. This may also hold true for raster images. If you just want to reduce white space, it is ok. –  pluton Jan 11 '11 at 21:30

If your figure is in pdf format, use pdfcrop to automatically crop all whitespace before inserting it.

If it's not in pdf format - you could create a pdf of it before. ;-)

Though there are graphic software tools to crop jpg and png as well. For example, ImageMagick with convert -trim filename on the command prompt.

-
pdfcrop is just what I needed, thanks :) –  Marin Jan 11 '11 at 20:32
\includegraphics[viewport=llx lly urx ury, clip]{file}
\includegraphics[trim=llx lly urx ury, clip]{file}

-
I know this, but I have to open the file, look for coordinates... –  Marin Jan 11 '11 at 20:29
@Marin: no, with package overpicyou can get a temporay grid –  Herbert Jan 11 '11 at 21:08