Need help

Questions and postings pertaining to the usage of ImageMagick regardless of the interface. This includes the command-line utilities, as well as the C and C++ APIs. Usage questions are like "How do I use ImageMagick to create drop shadows?".
Post Reply
mrbigball
Posts: 1
Joined: 2018-01-25T02:27:10-07:00
Authentication code: 1152

Need help

Post by mrbigball » 2018-01-31T21:23:13-07:00

Hi, i have created a text using

Code: Select all

convert -size 500x250 canvas:none -font Roboto-Regular -pointsize 160 -draw "text 90,230 '12.34'" -channel RGBA -blur 0x30 -fill white -draw "text 90,230 '12.34'" clock.png
which renders:
Image

Now, i am happy with the result apart from one thing, and it's the opacity of the shadow. How do i make the shadow less translucent?
The blur amount is correct so it's not a matter of decreasing the blur (which of course will increase the opacity but transform the shadow into a normal text contour).

thanks :D

User avatar
fmw42
Posts: 22683
Joined: 2007-07-02T17:14:51-07:00
Authentication code: 1152
Location: Sunnyvale, California, USA

Re: Need help

Post by fmw42 » 2018-01-31T21:30:47-07:00

Try

Code: Select all

convert -size 500x250 canvas:none -font Roboto-Regular -pointsize 160 -draw "text 90,230 '12.34'" -channel RGBA -blur 0x30 -auto-level -fill white -draw "text 90,230 '12.34'" clock1.png
Or

Code: Select all

convert -size 500x250 canvas:none -font Roboto-Regular -pointsize 160 -draw "text 90,230 '12.34'" -channel RGBA -blur 0x30 +level 30x100% -fill white -draw "text 90,230 '12.34'" clock2.png
Adjust the level values as desired

or

Code: Select all

convert -size 500x250 canvas:none -font Roboto-Regular -pointsize 160 -draw "text 90,230 '12.34'" -channel RGBA -blur 0x30 -contrast-stretch 1x1% -fill white -draw "text 90,230 '12.34'" clock3.png
adjust the contrast-stretch values as desired.

or

Code: Select all

convert -size 500x250 canvas:none -font Roboto-Regular -pointsize 160 -draw "text 90,230 '12.34'" -channel RGBA -blur 0x30 -evaluate pow 0.5 -fill white -draw "text 90,230 '12.34'" clock4.png
Adjust pow value as desired

User avatar
GeeMack
Posts: 531
Joined: 2015-12-01T22:09:46-07:00
Authentication code: 1151
Location: Central Illinois, USA

Re: Need help

Post by GeeMack » 2018-01-31T22:22:51-07:00

mrbigball wrote:
2018-01-31T21:23:13-07:00
Now, i am happy with the result apart from one thing, and it's the opacity of the shadow. How do i make the shadow less translucent?
The blur amount is correct so it's not a matter of decreasing the blur (which of course will increase the opacity but transform the shadow into a normal text contour).
You can also try adding a stroke to the first "-draw" operation like this...

Code: Select all

... -draw "stroke black stroke-width 20 text 90,230 '12.34'" ...
The blur becomes denser near the text because that adds 10 pixels to the outside of the text. It will increase the outer distance of the blur, but probably not by more than a few pixels. You can adjust the amount of the stroke-width to see if it gives you the result you want.

Post Reply