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 » 2019-01-30T07:05:13-07:00

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: 12306
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 » 2019-01-30T07:27:53-07:00

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 » 2019-01-30T07:53:11-07:00

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 » 2019-01-30T08:06:03-07:00

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: 12306
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 » 2019-01-30T08:15:36-07:00

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 » 2019-01-30T08:35:58-07:00

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: 25664
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 » 2019-01-30T10:49:38-07:00

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 » 2019-01-31T05:49:45-07:00

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 » 2019-01-31T17:13:41-07:00

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