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 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') 

shaped shadow wand


Comments

Popular posts from this blog

javascript - Laravel datatable invalid JSON response -

java - Exception in thread "main" org.springframework.context.ApplicationContextException: Unable to start embedded container; -

sql server 2008 - My Sql Code Get An Error Of Msg 245, Level 16, State 1, Line 1 Conversion failed when converting the varchar value '8:45 AM' to data type int -