$ convert in.png out.pdf
ImageMagick can do much, much more than conversions. Today I learned the following trick from an
e-mail list discussion:
$ convert -trim img.pdf
which trims all the white space from around an image. It's a great trick for inserting Matlab plots into papers! I used to do this by hand with an image editing program like the GIMP; it's great to know that I don't have to fire up such a massive tool in order to accomplish this simple task. (The GIMP is a wonderful program, incidentally, but starting it up just to crop some white space is a task beneath its mighty powers.)
8 comments:
I just had occasion to use it. That works great!
*grins* I feel useful :-D
hurruh, just what I was looking for. Thanks very much!
sweet!
Didnt need it, but used it anyhow.
Thank you for much for posting this tip!
We make use of ImageMagic heavily to form previews of stock photos, "-crop 0x0" tip works wonders on line-art and vector drawings :-)
A good example of this in play on our site: http://www.clipartstar.com/photos/ew3hwc/environmental-energy-symbols
Thank you again!
- Clipart Star team
Thank you for much for posting this tip!
We make use of ImageMagic heavily to form previews of stock photos, "-crop 0x0" tip works wonders on line-art and vector drawings :-)
A good example of this in play on our site: http://www.clipartstar.com/photos/ew3hwc/environmental-energy-symbols
Thank you again!
- Clipart Star team
I think you mean 'mogrify' rather than 'convert' (with 'convert' you need to specify an output file).
I also found the option -fuzz <%age> useful when using -trim as my white space wasn't as white as it might seem when looked at close up. 8% worked well for me.
Thanks Paul!
Post a Comment