Page 1 of 1

Create cross corners frame

Posted: 2012-02-23T12:45:31-07:00
by Mahroun
Too difficult for me, sorry
Can someone help me make a command line for ImageMagick that's will create a cross corners frame with edges length relative to the size of the window/picture size?

Here is a screenshot of how I'm doing/programming it now..

Image

Thanks anyway

Re: Create cross corners frame

Posted: 2012-02-23T14:26:34-07:00
by fmw42
This goes a bit further than what you want, but it might give you some ideas.

http://www.imagemagick.org/Usage/thumbn ... e_extended

Alternately, compute the size of the image that needs the border added, use the sizes to compute the end points you want. Then just draw lines using -draw. see http://www.imagemagick.org/Usage/draw/#primitives

Re: Create cross corners frame

Posted: 2012-02-23T15:18:56-07:00
by fmw42
try this, which I modified from http://www.imagemagick.org/Usage/thumbn ... e_extended:


Image

convert -size 1x1 xc:white border.gif
convert thumbnail.gif -matte -bordercolor none -border 34 \
\( -size 144x2 -tile-offset +30+0 tile:border.gif -transpose \) \
-geometry +32+10 -composite \
\( -size 144x2 -tile-offset +45+0 tile:border.gif -transpose \) \
-geometry +154+0 -composite \
\( -size 178x2 -tile-offset +60+0 tile:border.gif \) \
-geometry +0+32 -composite \
\( -size 178x2 -tile-offset +0+0 tile:border.gif \) \
-geometry +10+124 -composite \
thumbnail_frame.gif

Image

Re: Create cross corners frame

Posted: 2012-02-23T19:25:27-07:00
by anthony
Of course in this case the frame is just a solid color, so just adding a transparent border, and drawing the appropriate edge lines will do the job.


For course you can also just overlay the image first then draw the lines too!

Re: Create cross corners frame

Posted: 2012-02-24T00:46:24-07:00
by Mahroun
Thanks for trying fmw42, but the result is not good :(
The left vertical border is missing and the others are not aligned properly.
Also looking at your code it seems that dimensions are being passed which I thought ImageMagick will calculate automatically!

Re: Create cross corners frame

Posted: 2012-02-24T10:50:00-07:00
by fmw42
Mahroun wrote:Thanks for trying fmw42, but the result is not good :(
The left vertical border is missing and the others are not aligned properly.
Also looking at your code it seems that dimensions are being passed which I thought ImageMagick will calculate automatically!
You can adjust the dimensions to make it suit. In this code it will not automatically compute the coordinates. To do so you need to write a short script that accesses the images, computes their sizes and draws lines that are some percent bigger.

If you can provide the two images you are using and the placement of the inserted image, then we can probably do that for you. However, I only know bash shell scripting and know nothing about Windows. So if you are on windows, then someone else will need to help.