> I'm wondering how feasible it is to use ImageMagick tools to produce dotted characters for kids, so they can practice writing following those dotted letters.
Sure, if there is a will, there will be a solution in ImageMagick.
Thanks a lot to Fred (AKA fmw42)'s excellent work, the result is now acceptable (NB, it was already acceptable ever since my reply to Fred's first proposal).
As Fred stated in the first reply, there are several way to do it. Note that the purpose for this is for kids to practice writing following the dotted letters, so anything close enough can be the answer. My solution goes with the 3rd one, i.e., "create a dotted pattern, then tile that out the size of the edge image. Then use the edge image as a mask to over the dotted pattern so that the result might be a set of dotted lines rather than continuous ones." The result is close-enough to me.
> I think the most challenging part is that the letters has to be big enough for kids to follow yet the dots has to be small enough so as to be covered even by regular pencil/ball-pen.
To turn big and bulky letters into thin dots, several tricks has been played.
- 1st is to thin the image with "-morphology dilate disk:3.5"
- 2nd is to dot the edge instead of the whole stroke.
Detail steps as follows:
Code: Select all
# create Letter image
convert -font Arial -pointsize 96 label:ABC -morphology dilate disk:3.5 -negate tmp1.png
# Generates a edge image
convert tmp1.png -negate -morphology EdgeIn Diamond tmp2.png
# create grid of dots pattern
convert \( -size 1x1 xc:white xc:black +append \) \
\( -clone 0 -negate \) \
-append -write mpr:tile -+delete \
-size 199x109 tile:mpr:tile -negate tmp3.png
# composite edged image over grid of dot pattern, black on white, for priniting
convert tmp3.png tmp2.png -compose multiply -composite -negate tmp.png
tmp.png
Thanks