Transform image with imagemagick via command line?

1

How can I transform an image while maintaining its original size by cutting off some areas, and filling others (preferably with a specifiable background color), using Imagemagick on the windows command line:

Here is the basic idea.

enter image description here

Note: Please be sure the method is lossless if possible (besides the limitations of reading and writing from lossy formats).

GiantCowFilms

Posted 2016-10-11T17:39:49.153

Reputation: 141

Answers

0

Okay, after going through the Imagick documentation several times, I figured it out.

the page option is what I needed:

magick [input image] -page +20+20 -background black -flatten [output image]

the background can also be made transparent using the alpha option.

GiantCowFilms

Posted 2016-10-11T17:39:49.153

Reputation: 141