I have an input image with dimensions 160xY, and I want to resize it to 160xH, where H between 128 and 213 pixels.
If Y is more than 213, I want to cut the bottom of the image.
If Y is less than 128, I want to add transparent margin at top and bottom of the original image.
I tried
Code: Select all
convert input.jpg -background none -gravity North -crop 160x213+0+0 -gravity Center -extent "x128<" ouput.png
Is it a bug on the extent option ? How perform such a transformation ?