# VASSAL and ImageMagick

**URL:** <https://forum.vassalengine.org/t/vassal-and-imagemagick/11086>\
**Category:** Module Discussion\
**Created:** [August 31, 2020, 9:50pm UTC](https://forum.vassalengine.org/t/vassal-and-imagemagick/11086 "2020-08-31T21:50:15Z")\
**Posts on this page:** 1\
**Showing post:** 10

<div class="post-metadata">

**Author:** ![cholmcc](https://forum.vassalengine.org/user_avatar/forum.vassalengine.org/cholmcc/32/8319_2.png) [@cholmcc](https://forum.vassalengine.org/u/cholmcc)\
**Post date:** [March 7, 2025, 9:44am UTC](https://forum.vassalengine.org/t/vassal-and-imagemagick/11086/10 "2025-03-07T09:44:07Z")

</div>

Hi Jim _et al_,

> [@Jim\_Hunter](#):
>
> Hi Christian,
> 
> I did see your post last night.

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

> [@Jim\_Hunter](#):
>
> It works perfectly, and the timing is perfect for me.

Great. Good to know that it works.

> [@Jim\_Hunter](#):
>
> … [Normandy '44](https://boardgamegeek.com/boardgame/38718/normandy-44). [[VASSAL](https://vassalengine.org/wiki/Module:Normandy_%2744)]
> 
> ![US-4-8](https://forum.vassalengine.org/uploads/default/original/2X/6/65d8448b99aef315a01ec728000682159c0ccfb7.png)
> 
> Instead of drop shadows, the top and left sides fade lighter and the bottom and top sides fade to black. This gives them a very nice three dimensional appearance while retaining their original 84x84 pixel dimensions.

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 `magick`s `-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`](https://legacy.imagemagick.org/script/command-line-options.php?#frame) ([examples](https://legacy.imagemagick.org/Usage/crop/#frame)) 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.

> [@Jim\_Hunter](#):
>
> The best of my initial attempts to use your script to reproduce this appearance produced this look:
> 
> ![test_out](https://forum.vassalengine.org/uploads/default/original/2X/f/fd1073ab3ff033b01c6ca6cb9e4542f1f17522d0.png)
> 
> I used these arguments:
> 
> `piece_manip.sh --shave 2 2 --rounded 5 --drop 4 black 4 100 test.png`

**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

```

> [@Jim\_Hunter](#):
>
> The drop down shadows also give a 3D look, but not the same. Also, the dimensions of the counter have grown to 96x96.

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](https://forum.vassalengine.org/t/script-to-make-common-operations-on-piece-images/84787) on the script.

| | |
| --- | --- |
| ![](https://forum.vassalengine.org/uploads/default/original/2X/9/9d3219e67dabc5da829bbd182fcca038e9d158fa.png) | ![](https://forum.vassalengine.org/uploads/default/original/2X/c/c6422d48abf0acd6f3b1e6357b429a64cbb6436e.png) |

Yours,  
_Christian_

---

_[View the full topic](https://forum.vassalengine.org/t/vassal-and-imagemagick/11086)._
