[messages] [Module Design] Tips for Making Cards Look Nice and Straight?

Jym jean-yves.moyen at ens-lyon.org
Sat Mar 7 10:39:46 CET 2015


Hmmm.
I guess your cards are hand drawn (and not computer generated) since you
have to scan them…
Anyway, if you want, I have a bash script (for Linux, might work on
Mac) to automatically cut an image into tiny rectangular parts along a
grid, which I use for cutting images from a counters sheet or a cards
sheet. It needs the cards/counters to be perfectly straight because it's
cutting along vertical and horizontal lines only.
Here it is. You'll probably have to do some trial and errors with the
variables defined at start to find the correct values.

Code:
#!/bin/bash

# width and height of each sub-image
# cards : 250x350
# counters : 44x44 +    convert -frame 1x1+1+0
width=44;
height=44;

# offset of the top left corner of the images
# counters : 28,41
xinit=28;
yinit=41;

# space between image. Usefull to remove border from counters
# counters : 50x50
xspace=50;
yspace=50;

for page in 1 ; do
    xoff=`expr $xinit + $page \* 550`;
    for bloc in 4 ; do
        yoff=`expr $yinit + $bloc \* 112 + $bloc / 2`;
        for col in 4 ; do 
            for lig in 0; do 
                convert -crop ${width}x$height+`expr $xoff + $xspace \*
$col`+`expr $yoff + $yspace \* $lig` +repage $1
${1%.png}-$page-$bloc-$col-$lig.png ;
            done
        done
    done
done




_______________________________________________
Read this topic online here:
http://www.vassalengine.org/forum/viewtopic.php?p=48174#p48174


More information about the messages mailing list