imgscale command-line tool for scaling images usage Resize in.jpg to fit in a 400x800 box while preserving the aspect ratio. imgscale 400 800 < in.jpg > out.jpg