# 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:** 14\
**Page:** 1

<div class="post-metadata">

**Author:** ![grouchysmurf](https://forum.vassalengine.org/user_avatar/forum.vassalengine.org/grouchysmurf/32/142_2.png) [@grouchysmurf](https://forum.vassalengine.org/u/grouchysmurf)\
**Post date:** [August 31, 2020, 9:50pm UTC](https://forum.vassalengine.org/t/vassal-and-imagemagick/11086/1 "2020-08-31T21:50:15Z")

</div>

I made a website that collects different tutorials on ImageMagick use in context of wargame counters and VASSAL module design:

[vassal.pl/](https://vassal.pl/)

Maybe some of you will find it useful.

---

<div class="post-metadata">

**Author:** ![Jim\_Hunter](https://forum.vassalengine.org/letter_avatar_proxy/v4/letter/j/858c86/32.png) [@Jim\_Hunter](https://forum.vassalengine.org/u/Jim_Hunter)\
**Post date:** [March 1, 2025, 12:25am UTC](https://forum.vassalengine.org/t/vassal-and-imagemagick/11086/2 "2025-03-01T00:25:07Z")

</div>

For others (like me) who may have been interested in seeing this content, it appears that the website domain is now unclaimed.

---

<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 1, 2025, 8:25am UTC](https://forum.vassalengine.org/t/vassal-and-imagemagick/11086/3 "2025-03-01T08:25:49Z")

</div>

> [@Jim\_Hunter](#):
>
> it appears that the website domain is now unclaimed.

Try [here](https://web.archive.org/web/20220905173830/https://vassal.neocities.org/). Perhaps someone can make a [Documentation](https://forum.vassalengine.org/c/documentation/) post out of it.

Yours,  
_Christian_

---

<div class="post-metadata">

**Author:** ![Jim\_Hunter](https://forum.vassalengine.org/letter_avatar_proxy/v4/letter/j/858c86/32.png) [@Jim\_Hunter](https://forum.vassalengine.org/u/Jim_Hunter)\
**Post date:** [March 1, 2025, 2:54pm UTC](https://forum.vassalengine.org/t/vassal-and-imagemagick/11086/4 "2025-03-01T14:54:34Z")

</div>

Thanks Christian! - that content appears to be exactly what I was looking for!

I can’t make any promises, but I’ll look into capturing it into the Vassal documentation page.

Will that link to the archived website remain valid “forever”, or will it expire after some time?

Cheers,  
Jim Hunter.

---

<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 1, 2025, 3:22pm UTC](https://forum.vassalengine.org/t/vassal-and-imagemagick/11086/5 "2025-03-01T15:22:07Z")

</div>

> [@Jim\_Hunter](#):
>
> Will that link to the archived website remain valid “forever”, or will it expire after some time?

As long as the Wayback machine is funded, it will most likely stay there. However, it would make sense to put it on the VASSAL site as that is the most likely place people will look for such information.

---

<div class="post-metadata">

**Author:** ![Jim\_Hunter](https://forum.vassalengine.org/letter_avatar_proxy/v4/letter/j/858c86/32.png) [@Jim\_Hunter](https://forum.vassalengine.org/u/Jim_Hunter)\
**Post date:** [March 1, 2025, 4:15pm UTC](https://forum.vassalengine.org/t/vassal-and-imagemagick/11086/6 "2025-03-01T16:15:37Z")

</div>

Agreed. I just wanted to know the time urgency.

---

<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 6, 2025, 8:43am UTC](https://forum.vassalengine.org/t/vassal-and-imagemagick/11086/7 "2025-03-06T08:43:41Z")

</div>

See [here](https://forum.vassalengine.org/t/script-to-make-common-operations-on-piece-images/84787) for a script that does the most common operations.

---

<div class="post-metadata">

**Author:** ![Jim\_Hunter](https://forum.vassalengine.org/letter_avatar_proxy/v4/letter/j/858c86/32.png) [@Jim\_Hunter](https://forum.vassalengine.org/u/Jim_Hunter)\
**Post date:** [March 6, 2025, 3:38pm UTC](https://forum.vassalengine.org/t/vassal-and-imagemagick/11086/8 "2025-03-06T15:38:20Z")

</div>

Hi Christian,

I did see your post last night. I was very excited to try it but this morning was my first opportunity. It works perfectly, and the timing is perfect for me.

I had previously installed ImageMagick onto my Mac and used it to extract the counters from the counter sheets for the 2024 edition of Normandy '44. I am now ready to try using it to make the counters “pretty”.

My goal is to make them look like the ones that are found in the current (v0.94) version of the Normandy '44 vassal module, like this:

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

The drop down shadows also give a 3D look, but not the same. Also, the dimensions of the counter have grown to 96x96.

I intend to reach out to the Normandy 44 vassal designers on BoardGameGeek to see if they still have the original formula that they used to produce those counters, but if I am unsuccessful, I will appeal to the vassal community for help.

Thank you very much for producing that script!

Cheers,  
Jim Hunter.

---

<div class="post-metadata">

**Author:** ![JoelCFC25](https://forum.vassalengine.org/user_avatar/forum.vassalengine.org/joelcfc25/32/2687_2.png) [@JoelCFC25](https://forum.vassalengine.org/u/JoelCFC25)\
**Post date:** [March 6, 2025, 7:44pm UTC](https://forum.vassalengine.org/t/vassal-and-imagemagick/11086/9 "2025-03-06T19:44:55Z")

</div>

Looks like something that you’d routinely see people produce from using Paintshop Pro back in the day, using some kind of 3D bevel/buttonize effect that it had.

I’m sure ImageMagick can do the equivalent if you know the syntax backwards and forwards, which I don’t.

---

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

---

<div class="post-metadata">

**Author:** ![Jim\_Hunter](https://forum.vassalengine.org/letter_avatar_proxy/v4/letter/j/858c86/32.png) [@Jim\_Hunter](https://forum.vassalengine.org/u/Jim_Hunter)\
**Post date:** [March 7, 2025, 3:07pm UTC](https://forum.vassalengine.org/t/vassal-and-imagemagick/11086/11 "2025-03-07T15:07:16Z")

</div>

Hi Christian,

Your addition sounds like it may be exactly what I need. However, the download link found on the updated documentation page downloads a version that does not include the new **–shade** feature. Have the GitHub contents been updated?

Cheers,  
Jim Hunter.

---

<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, 3:34pm UTC](https://forum.vassalengine.org/t/vassal-and-imagemagick/11086/12 "2025-03-07T15:34:42Z")

</div>

Hi Jim,

> [@Jim\_Hunter](#):
>
> However, the download link found on the updated documentation page downloads a version that does not include the new **–shade** feature. Have the GitHub contents been updated?

Sorry, my mistake - forgot to `push` the changes. Try now.

Yours,  
_Christian_

---

<div class="post-metadata">

**Author:** ![Jim\_Hunter](https://forum.vassalengine.org/letter_avatar_proxy/v4/letter/j/858c86/32.png) [@Jim\_Hunter](https://forum.vassalengine.org/u/Jim_Hunter)\
**Post date:** [March 7, 2025, 5:07pm UTC](https://forum.vassalengine.org/t/vassal-and-imagemagick/11086/13 "2025-03-07T17:07:26Z")

</div>

Hi Christian,

That worked. I now have the new **–shade** feature, and I’m playing with it now. I’m still trying various combinations of script options, but it looks like this will fill my need.

I am really grateful for your work on this. It was a huge time saver for me, and I suspect it will be for a lot of other vassal module designers also.

Cheers,  
Jim.

BTW, I found a couple of nits with the **–long-help** output. The line which begins the **–shade** section is indented too far, and the line which begins the **–rounded** section has a typo (–rounced).

---

<div class="post-metadata">

**Author:** ![ChuckS](https://forum.vassalengine.org/letter_avatar_proxy/v4/letter/c/db5fbb/32.png) [@ChuckS](https://forum.vassalengine.org/u/ChuckS)\
**Post date:** [March 7, 2025, 6:22pm UTC](https://forum.vassalengine.org/t/vassal-and-imagemagick/11086/14 "2025-03-07T18:22:44Z")

</div>

LOL need to convert all the modules to clipped counter looks to drive the unclippers cra cra lol!
