I'm writing a GNU Makefile to do some processing on images. One task is to scale the image (.ppm format) by a SIZE parameter using the pnmscale command. The image should be scaled by the longer side without loosing the ratio and should be saved under .scaled .
I've read the man page of pnmscale but couldn't seem to find the right option.
I've tried the following:
pnmscale -pixels 100 example.ppm > example.scaled
When example.ppm
has the size 200 x 100 pixels
and I run the pnmscale command with the size of 100 pixels
, example.scaled
should have the size of 100 x 50 pixels
. With my solution the image gets very small.