Page 1 of 1

Creating a box with inner shadow and image

Posted: 2011-07-24T20:15:22-07:00
by mrblackman
Anyone have any idea if IM can be used to basically create this image from a simple square image (i.e. an instagram image):

http://cl.ly/2U1y1D2g101K3k1U462A

Its essentially a white border of around 15 around an image followed by another border with a neat inner shadow effect.

Thoughts?

Josh

Re: Creating a box with inner shadow and image

Posted: 2011-07-24T20:33:22-07:00
by fmw42
Something like this from my script imageborder, see link below:

Image

imageborder -s 5 -m black -p 75 -r white -t 15 -e edge -f inner zelda1.jpg zelda1_border.jpg


Image


The outer shading could be modified to make it softer.

See
http://www.imagemagick.org/Usage/crop/#border
http://www.imagemagick.org/Usage/thumbnails/#frame
http://www.imagemagick.org/Usage/thumbnails/#framing
http://www.imagemagick.org/Usage/blur/#blur

OR using the above commands:


convert \( zelda1.jpg -bordercolor white -border 15 \) \
\( -clone 0 -fill black -frame 5x5+0+5 \) \
+swap -gravity center -compose over -composite zelda1_border2.jpg

Image

OR with a softer bevel


convert \( zelda1.jpg -bordercolor white -border 15 \) \
\( -clone 0 -mattecolor black -frame 5x5+0+5 -blur 0x2 \) \
\( -clone 0 -shave 5x5 \) \
-delete 0 -gravity center -compose over -composite zelda1_border3.jpg


Image

Re: Creating a box with inner shadow and image

Posted: 2011-07-25T05:42:25-07:00
by mrblackman
I don't know what's more amazing - ImageMagick or the support of this forum.

That worked great. One last thing - is it possible to either add a random patterned background/border or place the newly created image on top of a pattern that would fill the whole screen?

Right now my background looks like this:

ImageClick for large view - Uploaded with Skitch

and updates every 5 minutes from Instagram. Thats nice and all, but would be nicer if the blue (or whatever color) background had some texture to it.

Thanks again,

J

Re: Creating a box with inner shadow and image

Posted: 2011-07-25T10:29:31-07:00
by fmw42
try this, but adjust the 640x480 to your screen resolution


convert \( zelda1.jpg -bordercolor white -border 15 \) \
\( -clone 0 -mattecolor black -frame 5x5+0+5 -blur 0x2 \) \
\( -clone 0 -shave 5x5 \) \
-delete 0 -gravity center -compose over -composite \
\( -size 640x480 xc: +noise random \) \
+swap -gravity center -compose over -composite \
zelda1_border4.jpg

Image

or
convert \( zelda1.jpg -bordercolor white -border 15 \) \
\( -clone 0 -mattecolor black -frame 5x5+0+5 -blur 0x2 \) \
\( -clone 0 -shave 5x5 \) \
-delete 0 -gravity center -compose over -composite \
\( -size 640x480 plasma: \) \
+swap -gravity center -compose over -composite \
zelda1_border5.jpg

Image

see

http://www.imagemagick.org/Usage/canvas/#random
http://www.imagemagick.org/Usage/canvas ... _gradients

also see tiling from some small image for the background
http://www.imagemagick.org/Usage/canvas/#tile

Image

convert \( zelda1.jpg -bordercolor white -border 15 \) \
\( -clone 0 -mattecolor black -frame 5x5+0+5 -blur 0x2 \) \
\( -clone 0 -shave 5x5 \) \
-delete 0 -gravity center -compose over -composite \
\( -size 640x480 tile:tile_aqua.jpg \) \
+swap -gravity center -compose over -composite \
zelda1_border6.jpg

Image

Re: Creating a box with inner shadow and image

Posted: 2011-07-25T11:26:18-07:00
by mrblackman
Once again, amazing. Its now selecting from a dir of different backgrounds. Thanks!

If you use Instagram and want the script, let me know.

-J


ImageClick for large view - Uploaded with Skitch

Re: Creating a box with inner shadow and image

Posted: 2011-07-25T18:55:17-07:00
by anthony
You may also like to look though the various methods of adding 'fluff' to thumbnails...
http://www.imagemagick.org/Usage/thumbnails/#fluff