Your friend Convert

by Jane on November 18, 2009

Do you use the tool “convert” to manipulate plots and images?  It’s simple, powerful and downright great!  Quick examples:

Modify a plot for presentation use, by swapping to a black background with white lines, so it’s easier to read on a screen:

> convert  -negate frompaper.ps  forscreen.jpg

Make a thumbnail:

> convert -geometry 50×50 big.jpg thumbnail.gif

Blur an image w a Gaussian (for easier Journal Club reading of little datapoints):

>convert -gaussian 2×2  hard2read.ps  easy2read.gif

Other tools can do all these tasks, of course.  The advantage of Convert is that it’s very simple, fast to type, and scriptable.  Convert is part of the open-source ImageMagick package, which is easy to install in linux or OS X.   Quick, what are some other astronomy-relevant uses of Convert?

{ 1 comment… read it below or add one }

1 Sean Carey November 24, 2009 at 8:20 pm

To please my bosses, I have to provide a little higher resolution for some graphics than convert will give you. For making a high-quality png file to dump into a presentation, I use pstopnm and pnmtopng (which are part of the netpbm library. These lines will make a decent output from .eps files from IDL (for instance). The netpbm routines have a lot of functionality if you have the time to learn and play with them,

> pstopnm -portrait -dpi=600 fig.eps
> pnmtopnm fig.eps001.ppm > fig.pnm

Reply

Leave a Comment

Previous post:

Next post: