views:

32

answers:

1

http://i51.tinypic.com/15wcw2d.jpg

This is an animation I made using Mathematica. As can be seen by highlighting the image, the margins at both the left and right sides are too wide. I don't want to have to submit the image to another program just for the cropping, so what do I do to eliminate the whitespace?

Looking at the documentation, ImageMargins and ImageRegion would have been good except that they only apply to the front end. So, what do I do?

+1  A: 

First, I would try the PlotRangePadding option to your Plot function. If the expression is already rasterized, you can try something like this:

imagelist /. Raster[a_, rest___]:> Raster[Take[#, {10, -10}]& /@ a, rest]

This should chop 10 pixels off either side. The image processing tools in V7 are quite nice and if you are able, I think you'd find the upgrade a very worthwhile investment.

Joshua Martell
`PlotRangePadding` is new as of Mathematica version 6, sad to say.
Pillsy