I don't want to center the cropped images horizontally, because all the pages are different lengths
So I want to add a 28px border to the top instead
Then I want to pad the remainder of the image at the bottom to make it 1024px high.
I've managed to create the following code so far to crop the top and the bottom of the image...
Code: Select all
magick *.png -set filename:f "%[t]" ^
-set option:dimensions "%wx%h" ^
-background black -fuzz 25% ^
-gravity north -splice 0x1 ^
-trim +repage -gravity north -chop 0x1 ^
-gravity south -splice 0x1 ^
-trim +repage -gravity south -chop 0x1 ^
"c:\users\brad\downloads\cleaned\%[filename:f].png"