create text shadow
- fmw42
- Posts: 25562
- Joined: 2007-07-02T17:14:51-07:00
- Authentication code: 1152
- Location: Sunnyvale, California, USA
Re: create text shadow
Have you tried to adapt it to your example code? If you have and cannot figure it out, then post your original sunrise-sea.jpg so I have something to work against your code.
Also adding shadow to a small pointsize and black text is not going to be very impressive. You need some contrast between the font color and the shadow and a larger font size to be effective.
Also adding shadow to a small pointsize and black text is not going to be very impressive. You need some contrast between the font color and the shadow and a larger font size to be effective.
Re: create text shadow
Here is my sunrise-sea.jpg
Here are what I want to do:
Using sunrise-sea.jpg, I want:
1. create a rectangular box with size 500x200 (box1)
2. put a text inside that box1, the point is font will be larger/smaller automatically according to nums of characters.
3. create a rectangular box (box2)
with this command I can accomplish that:
result:
then I want to make the text shadowed
Using your command, I can only achieved this:
and the result:
Thank you...
Here are what I want to do:
Using sunrise-sea.jpg, I want:
1. create a rectangular box with size 500x200 (box1)
2. put a text inside that box1, the point is font will be larger/smaller automatically according to nums of characters.
3. create a rectangular box (box2)
with this command I can accomplish that:
Code: Select all
convert sunrise-sea.jpg \
-size 500x200! -font Ubuntu-Bold-Italic -background none \
label:"The only thing that interferes with my learning is my education.\nALBERT EINSTEIN" \
-geometry +50+180 -composite -fill none -strokewidth 2. \
-stroke black -draw "rectangle 20, 20, 580, 380" \
test.png
then I want to make the text shadowed
Using your command, I can only achieved this:
Code: Select all
convert sunrise-sea.jpg \
-size 500x200! \
\( -background none -font arial -pointsize 48 \
-fill black label:"The only thing that interferes with my learning is my education.\nALBERT EINSTEIN" -trim +repage \) \
\( -clone 1 -background blue -shadow 80x3+5+5 \) \
\( -clone 1 -clone 2 +swap -background none -layers merge +repage \) \
-delete 1,2 \
-stroke black -draw "rectangle 20, 20, 580, 380" \
-compose over -composite \
result.png
Thank you...
- fmw42
- Posts: 25562
- Joined: 2007-07-02T17:14:51-07:00
- Authentication code: 1152
- Location: Sunnyvale, California, USA
Re: create text shadow
Try this:
Change the -fill white in the third line if you want black text rather than white.
Sorry I do not have your exact font, but you can change arial to your font name or to the path to your font file.
Code: Select all
convert yMaXdfL.jpg \
\( -size 500x200! -background none -gravity center -font arial \
-fill white \
label:"The only thing that interferes with my learning is my education.\nALBERT EINSTEIN" \
-trim +repage \) \
\( -clone 1 -background black -shadow 80x3+5+5 \) \
\( -clone 1 -clone 2 +swap -background none -layers merge +repage \) \
-delete 1,2 \
-gravity center -compose over -composite \
-fill none -stroke black -draw "rectangle 20, 20, 580, 380" -alpha off \
result.png
Sorry I do not have your exact font, but you can change arial to your font name or to the path to your font file.
Re: create text shadow
I don't want the -gravity center param, I need to place the text manually inside 500x200! box
Code: Select all
-geometry +50+180 -composite -fill none -strokewidth 2. \
- fmw42
- Posts: 25562
- Joined: 2007-07-02T17:14:51-07:00
- Authentication code: 1152
- Location: Sunnyvale, California, USA
Re: create text shadow
Simple enough to change.
Code: Select all
convert yMaXdfL.jpg \
\( -size 500x200! -background none -gravity center -font arial \
-fill white \
label:"The only thing that interferes with my learning is my education.\nALBERT EINSTEIN" \
-trim +repage \) \
\( -clone 1 -background black -shadow 80x3+5+5 \) \
\( -clone 1 -clone 2 +swap -background none -layers merge +repage \) \
-delete 1,2 \
+gravity -geometry +50+180 -compose over -composite \
-fill none -stroke black -strokewidth 2 -draw "rectangle 20, 20, 580, 380" -alpha off \
result.png
Re: create text shadow
If I have longer text like below, it becomes unreadable...
result:
any idea on how to make text auto shrink/expand according to sum of characters? or any better idea?
Thank you
Code: Select all
convert yMaXdfL.jpg \
\( -size 500x200! -background black -gravity center -font arial \
-fill white \
label:"Lorem Ipsum is simply dummy text of the printing and typesetting industry. Lorem Ipsum has been the industry's standard dummy text ever since the 1500s, The only thing that interferes with my learning is my education.\nALBERT EINSTEIN" \
-trim +repage \) \
\( -clone 1 -background black -shadow 80x3+5+5 \) \
\( -clone 1 -clone 2 +swap -background none -layers merge +repage \) \
-delete 1,2 \
+gravity -geometry +50+180 -compose over -composite \
-fill none -stroke black -strokewidth 2 -draw "rectangle 20, 20, 580, 380" -alpha off \
result.png
any idea on how to make text auto shrink/expand according to sum of characters? or any better idea?
Thank you
- fmw42
- Posts: 25562
- Joined: 2007-07-02T17:14:51-07:00
- Authentication code: 1152
- Location: Sunnyvale, California, USA
Re: create text shadow
You may need to use caption: and a pointsize with only -size Wx to define the width to keep larger type. The label: command is going to shrink the text to fit one line as wide as you specified in -size WxH. You also change the background of the text to black and the shadow won't show well that way. Try this and adjust the pointsize as desired.
Code: Select all
convert yMaXdfL.jpg \
\( -size 500x -background none -gravity center -font arial -pointsize 18 \
-fill white \
caption:"Lorem Ipsum is simply dummy text of the printing and typesetting industry. Lorem Ipsum has been the industry's standard dummy text ever since the 1500s, The only thing that interferes with my learning is my education.\nALBERT EINSTEIN" \
-trim +repage \) \
\( -clone 1 -background black -shadow 80x3+5+5 \) \
\( -clone 1 -clone 2 +swap -background none -layers merge +repage \) \
-delete 1,2 \
+gravity -geometry +50+180 -compose over -composite \
-fill none -stroke black -strokewidth 2 -draw "rectangle 20, 20, 580, 380" -alpha off \
result.png
Re: create text shadow
Additional questions...
How to create 2 text with different font setting, in my command example, "Indonesia" below "America".
Both need shadowed too.
Here is what I'm tryin' and failed...
Thank you...
How to create 2 text with different font setting, in my command example, "Indonesia" below "America".
Both need shadowed too.
Here is what I'm tryin' and failed...
Code: Select all
convert yMaXdfL.jpg \
\( -size 500x -background none -font Courier10PitchB -pointsize 30 -fill white \
caption:"America." -trim +repage \) \
\( -size 500x -background none -font Arial -pointsize 30 -fill white \
caption:"Indonesia." -trim +repage \) \
\( -clone 1 -background black -shadow 80x3+5+5 \) \
\( -clone 1 -clone 2 +swap -background none -layers merge +repage \) \
-delete 1,2 -gravity center -compose over -composite -fill none \
-stroke black -strokewidth 2 -alpha off result.png