VASSAL and ImageMagick

Hi Jim et al,

I just made a post in case someone was monitoring this thread :slight_smile:

Great. Good to know that it works.

The image above doesn’t have a drop shadow really. Rather, it’s a shaded “bevel”. However, the --bevel option of piece_manip.sh (which uses magicks -raise operation) only works on the edges of the bounding box of the image. That means, it cannot produce the effect you have above.

I think, perhaps, the right Imagemagick operation is rather -frame (examples) but with a bit more operations. Essentially, starting from an image with rounded corners, I think one need to make another image (-clone), fill it wit some colour, shrink it a bit, then add a frame, turn the colour to transparent, and compose it with the original image.

Hint: Use three back-ticks around “code”, as ``` code ``` (as edited above), to make things like command lines etc. easier to read - or put on separate line, indented by four space, like so

piece_manip.sh --shave 2 2 --rounded 5 --drop 4 black 4 100 test.png

Personally, I prefer the kind of drop shadow you got above, especially because it will cast a shadow on the board and other pieces beneath it - I think that looks better. But, I get you’d like the bevel-like shading too.

When you do

--drop SIZE COLOUR FADE OPACITY 

then SIZE pixels will be added to the bottom and right side of the image, and 1.5 times FADE pixels will be added to the all edges of the image. In your case

84 - 2 * 2 (shave) + 4 (drop SIZE) + 2 * 1.5 * 4 (FADE) = 96

You can set SIZE=0 and shave off a few more pixels. However, a drop-shadow, like the one above, will increase the size of the image.

I’ve updated the script a bit (re-download). Some optimisations and such. But I’ve also added the operation -shade which will do the smooth bevel you have above. See the page on the script.

Yours,
Christian