2

In Crop and resize image to fit a5 pdf I asked how to fit an image in a landscape A5.

Now I'd like to add a border or frame for the image and a tagline in the bottom (between the bottom line and the image).

Is this possible using ImageMagikc?

1

You can do that with the help of the -draw operator:

convert in.png -fill none -stroke black -strokewidth ${WIDTH} -draw "rectangle ${X1},${Y1} ${X2},${Y2}" out.png

where: WIDTH - stroke width
X1 - x coordinate of the top left corner
Y1 - y coordinate of the top left corner
X2 - x coordinate of the bottom right corner
Y2 - y coordinate of the bottom right corner

So e.g. for your other image that you want to crop+resize+convert to PDF you could run:

convert out.png -resize 2362x1630 -background white -gravity center -extent 2480x1748 \
-fill none -stroke black -strokewidth 10 -draw "rectangle 20,20 2460,1728" out.pdf

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.