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
Creating a box with inner shadow and image
-
- Posts: 6
- Joined: 2010-12-05T06:06:56-07:00
- Authentication code: 8675308
- fmw42
- Posts: 25562
- Joined: 2007-07-02T17:14:51-07:00
- Authentication code: 1152
- Location: Sunnyvale, California, USA
Re: Creating a box with inner shadow and image
Something like this from my script imageborder, see link below:

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

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

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


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

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

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

-
- Posts: 6
- Joined: 2010-12-05T06:06:56-07:00
- Authentication code: 8675308
Re: Creating a box with inner shadow and image
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:
Click 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
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:

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
- fmw42
- Posts: 25562
- Joined: 2007-07-02T17:14:51-07:00
- Authentication code: 1152
- Location: Sunnyvale, California, USA
Re: Creating a box with inner shadow and image
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

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

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

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

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

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

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

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

-
- Posts: 6
- Joined: 2010-12-05T06:06:56-07:00
- Authentication code: 8675308
Re: Creating a box with inner shadow and image
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
Click for large view - Uploaded with Skitch
If you use Instagram and want the script, let me know.
-J

- anthony
- Posts: 8883
- Joined: 2004-05-31T19:27:03-07:00
- Authentication code: 8675308
- Location: Brisbane, Australia
Re: Creating a box with inner shadow and image
You may also like to look though the various methods of adding 'fluff' to thumbnails...
http://www.imagemagick.org/Usage/thumbnails/#fluff
http://www.imagemagick.org/Usage/thumbnails/#fluff
Anthony Thyssen -- Webmaster for ImageMagick Example Pages
https://imagemagick.org/Usage/
https://imagemagick.org/Usage/