adding fancy border to an image using command

Questions and postings pertaining to the usage of ImageMagick regardless of the interface. This includes the command-line utilities, as well as the C and C++ APIs. Usage questions are like "How do I use ImageMagick to create drop shadows?".
Post Reply
manit
Posts: 123
Joined: 2009-01-30T22:31:26-07:00

adding fancy border to an image using command

Post by manit »

hi,
I have a black and white image of arbitrary dimension.
I want to add curly bracket kind of border to it on all sides.
How should I go about it ?
I am looking for command line approach in which I can fill in image dimension.

Thanks .
snibgo
Posts: 12159
Joined: 2010-01-23T23:01:33-07:00
Authentication code: 1151
Location: England, UK

Re: adding fancy border to an image using command

Post by snibgo »

manit wrote:How should I go about it ?
Any way you want. Do you have an image for the "curly bracket kind of border"? If not, you'll need to create one. This might be a small part of the required border that is then tiled, perhaps mirror-imaging alternate tiles. Use as many tiles as you need for each side. To get good mitred corners, use an integer number of tiles on all sides.
snibgo's IM pages: im.snibgo.com
manit
Posts: 123
Joined: 2009-01-30T22:31:26-07:00

Re: adding fancy border to an image using command

Post by manit »

Sir,
please see https://www.free-power-point-templates. ... -template/

That circular dotted border will do .
manit
Posts: 123
Joined: 2009-01-30T22:31:26-07:00

Re: adding fancy border to an image using command

Post by manit »

That is - I have a text written in black on white background .
The canvas is a rectangle.
I want it to be surrounded by design on all sides .
I will take printout in black & white.

Thanks.
snibgo
Posts: 12159
Joined: 2010-01-23T23:01:33-07:00
Authentication code: 1151
Location: England, UK

Re: adding fancy border to an image using command

Post by snibgo »

Windows syntax:

Code: Select all

magick template_main.jpg -resize 300x300^! ..\toes.png -gravity Center -composite dotty_border.jpg
Image
snibgo's IM pages: im.snibgo.com
manit
Posts: 123
Joined: 2009-01-30T22:31:26-07:00

Re: adding fancy border to an image using command

Post by manit »

okay .
I will try that .

I got a better image https://pixabay.com/get/eb35b20e2af7053 ... 031234.svg
This is an svg .
I hope - i can resize it disregarding aspect ratio so that it frames the rectangular image in a better way.
Can you help me in this ?

Thanks.
User avatar
fmw42
Posts: 25562
Joined: 2007-07-02T17:14:51-07:00
Authentication code: 1152
Location: Sunnyvale, California, USA

Re: adding fancy border to an image using command

Post by fmw42 »

This last URL is not valid
manit
Posts: 123
Joined: 2009-01-30T22:31:26-07:00

Re: adding fancy border to an image using command

Post by manit »

that URL expired , was working when I posted it.
Sorry about that.
Posted PNG version of that SVG as leafy.png .

So I figured it out with inputs from snibgo post

Here is my batch script for windows that takes file name as input and frames it inside bigger image (leafy.png) then resizes resultant composite to 10:7 ratio for landscape printing on A4 paper.
Leaving aside 15% on all sides of leafy.png rest gets overlaid with user fed image.
SET /P _inputname= Please enter file name without extension :
convert %_inputname%.png -resize 1173x1173! %_inputname%.png
composite.exe %_inputname%.png leafy.png -gravity Center -resize 100%%x70%%! big-%_inputname%-with-background.png
leafy.png is https://ibb.co/hB5KSTF

Thanks.
User avatar
anthony
Posts: 8883
Joined: 2004-05-31T19:27:03-07:00
Authentication code: 8675308
Location: Brisbane, Australia

Re: adding fancy border to an image using command

Post by anthony »

Unless the picture you want to frame fits in to your 'leafy image nicely... You may want to break up leafy into sub pictures, and then add them around your picture. Something like the "picture frame" process in
http://www.imagemagick.org/Usage/thumbnails/#frame_edge

It all depends on exactly what you want.
Basically break up your problem into steps and apply the steps.
Anthony Thyssen -- Webmaster for ImageMagick Example Pages
https://imagemagick.org/Usage/
Post Reply