python - Shaped shadows with wand -
are there functions equivalent to:
convert -background none -stroke black -fill white \ -font candice -pointsize 48 label:a -trim \ \( +clone -background navy -shadow 80x3+3+3 \) +swap \ -background none -layers merge +repage shadow_a.png
which produces 'a' blue shadow.
i have searched docs thoroughly couldn't find anything.
not possible yet?
not cli methods present in c-api library wand integrates with. however, behavior methods straight forward (e.g. +swap
), , free implement them application sees fit.
from wand.image import image wand.color import color wand.drawing import drawing wand.compat import nested nested(image(width=100, height=100, background=color("transparent")), image(width=100, height=100, background=color("transparent"))) (text, shadow): drawing() ctx: ctx.stroke_color = color("black") ctx.fill_color = color("white") ctx.font_size = 48 ctx.text(text.width/2, text.height/2, 'a') ctx(text) drawing() ctx: ctx.fill_color = color("navy") ctx.font_size = 48 ctx.text(text.width/2, text.height/2, 'a') ctx(shadow) shadow.gaussian_blur(80, 3) shadow.composite(text, -3, -3) shadow.trim() shadow.save(filename='shadow_a.png')
Comments
Post a Comment