Saturday, February 28, 2015

One-liner command for changing image resolution

The command in this post requires the GraphicsMagick package (see this for an explanation). GraphicsMagick commands start with gm in front of them.

Use the following command in Terminal, and GraphicsMagick will change your image resolution.
gm convert original.jpg -resize 120x120 output.jpg
The image will be scaled so its largest dimension is 120 pixels.

See this for an explanation of what other options are available for this command.

No comments:

Post a Comment