3D text + texture + shadow

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?".
tunezio
Posts: 26
Joined: 2016-08-09T08:59:20-07:00
Authentication code: 1151

3D text + texture + shadow

Post by tunezio »

Hi,

I want to get the text like picture below (3D text + texture + shadow)

Help me please

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

Re: 3D text + texture + shadow

Post by fmw42 »

What is your IM version and platform? Please always provide that.

If on Unix, then you might check my scripts 3Dtext and texteffect2.
tunezio
Posts: 26
Joined: 2016-08-09T08:59:20-07:00
Authentication code: 1151

Re: 3D text + texture + shadow

Post by tunezio »

Hello,

Thank you for quick answer. I use
here's a piece of my code:

Code: Select all

/usr/bin/convert -channel RGBA -background none -gravity Center -fill "#282951" -pointsize 104 -size x104 -font "oldeenglish.ttf" label:"My Text" -trim -resize "192x104>" -extent 192x104 088f68a48dd4116b067fda9066b2be54.png
I can't find the correct combination to make this effect.
I tried several methods for two weeks and I have not succeeded.

Help me please
tunezio
Posts: 26
Joined: 2016-08-09T08:59:20-07:00
Authentication code: 1151

Re: 3D text + texture + shadow

Post by tunezio »

Hello

it's urgent, please, I need help
snibgo
Posts: 12159
Joined: 2010-01-23T23:01:33-07:00
Authentication code: 1151
Location: England, UK

Re: 3D text + texture + shadow

Post by snibgo »

Have you looked at Fred's scripts 3Dtext and texteffect2?
snibgo's IM pages: im.snibgo.com
tunezio
Posts: 26
Joined: 2016-08-09T08:59:20-07:00
Authentication code: 1151

Re: 3D text + texture + shadow

Post by tunezio »

thank you for your answer,
I've looked, but I could not integrate it. I am working on a php web site under a linux server
snibgo
Posts: 12159
Joined: 2010-01-23T23:01:33-07:00
Authentication code: 1151
Location: England, UK

Re: 3D text + texture + shadow

Post by snibgo »

Do Fred's scripts do what you want? They can be run from exec() in PHP, I am told, but I don't do PHP.

If they don't do what you want, please say what else you need.
snibgo's IM pages: im.snibgo.com
Bonzo
Posts: 2971
Joined: 2006-05-20T08:08:19-07:00
Location: Cambridge, England

Re: 3D text + texture + shadow

Post by Bonzo »

You can run Fred's scripts in php although if you are using them commercially I believe you need a licence.
tunezio
Posts: 26
Joined: 2016-08-09T08:59:20-07:00
Authentication code: 1151

Re: 3D text + texture + shadow

Post by tunezio »

i don't need Fred's scripts.
i only need help to find the correct combination with convert to make the effects like a photo below
Currently i use this code to generate a picture with text :

Code: Select all

/usr/bin/convert -channel RGBA -background none -gravity Center -fill "#282951" -pointsize 104 -size x104 -font "oldeenglish.ttf" label:"My Text" -trim -resize "192x104>" -extent 192x104 088f68a48dd4116b067fda9066b2be54.png
User avatar
fmw42
Posts: 25562
Joined: 2007-07-02T17:14:51-07:00
Authentication code: 1152
Location: Sunnyvale, California, USA

Re: 3D text + texture + shadow

Post by fmw42 »

Does this do what you want?

Code: Select all

convert -background none -gravity center -fill "gray(80%)" -pointsize 104 \
-font /Library/fonts/OldeEnglish.ttf label:"Votre Texte" \
-alpha off +noise gaussian -colorspace gray -alpha on \
-shade 135x45 3D_textured_text.png
Image

or this adding a little blur to the alpha channel

Code: Select all

convert -background none -gravity center -fill "gray(80%)" -pointsize 104 \
-font /Library/fonts/OldeEnglish.ttf label:"Votre Texte" \
-channel alpha -blur 0x1 -auto-level +channel \
-alpha off +noise gaussian -colorspace gray -alpha on \
-shade 135x45 3D_textured_text2.png
Image

or increasing the blur value

Code: Select all

convert -background none -gravity center -fill "gray(80%)" -pointsize 104 \
-font /Library/fonts/OldeEnglish.ttf label:"Votre Texte" \
-channel alpha -blur 0x2 -auto-level +channel \
-alpha off +noise gaussian -colorspace gray -alpha on \
-shade 135x45 3D_textured_text3.png
Image


If the noise texture is too much add -attenuate 0.5 before +noise.

Code: Select all

convert -background none -gravity center -fill "gray(80%)" -pointsize 104 \
-font /Library/fonts/OldeEnglish.ttf label:"Votre Texte" \
-channel alpha -blur 0x2 -auto-level +channel \
-alpha off -attenuate 0.5 +noise gaussian -colorspace gray -alpha on \
-shade 135x45 3D_textured_text4.png
Image


or -attenuate 0.25. Adjust the attenuate value as desired.

Code: Select all

convert -background none -gravity center -fill "gray(80%)" -pointsize 104 \
-font /Library/fonts/OldeEnglish.ttf label:"Votre Texte" \
-channel alpha -blur 0x2 -auto-level +channel \
-alpha off -attenuate 0.25 +noise gaussian -colorspace gray -alpha on \
-shade 135x45 3D_textured_text5.png
Image
tunezio
Posts: 26
Joined: 2016-08-09T08:59:20-07:00
Authentication code: 1151

Re: 3D text + texture + shadow

Post by tunezio »

Thank you for your answer.

I have some details to add:
- I already have the texture as png image.
- I have to apply color to the texture as in this picture.
Image
- I want to add shadow for text
- I want add a frame with transaprent or with background color.
- I want to add au top border and a bottom border with the same text color

The final effect should like this

Image

Thanks
Last edited by tunezio on 2016-11-25T08:54:30-07:00, edited 1 time in total.
User avatar
fmw42
Posts: 25562
Joined: 2007-07-02T17:14:51-07:00
Authentication code: 1152
Location: Sunnyvale, California, USA

Re: 3D text + texture + shadow

Post by fmw42 »

Sorry I do not know what you want. Please provide all your input data and explain clearly or make a drawing showing what you want where.

Please explain also about what you mean by "3D". What is to be in 3D, the whole picture or just the text? If just the text, do you mean just "raised" or do you mean "curved"? If the whole picture is in 3D, then do you mean it has some shape? What shape?

We need a lot more explanation of the effect you want?
tunezio
Posts: 26
Joined: 2016-08-09T08:59:20-07:00
Authentication code: 1151

Re: 3D text + texture + shadow

Post by tunezio »

Thank you
- I have an input text, I have to add a background texture (texture with picture) having the possibility to choose a color for it.
Texture : Image

text with texture and color : Image

- I have to add a 3D effect to approach reality (shadow for the text, for example). To this end, I do not know if 'rised' or curved to better reflect the effect in the image below
Image

- I must have the ability to add a frame to the image that must consider the texture too.

Image

- I must have the ability to add a background for the text to limit the frame.

Image

- I must have the ability to add just a top and bottom border of the image.

Image

The result must like the image below

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

Re: 3D text + texture + shadow

Post by fmw42 »

Your examples show simple text on textured background. I am not sure what you want. Do you want the text to have texture or only the background to have texture?

If the former, then

#line1-2 creates white text on black background
#line3 tiles your texture image to the same size
#line4 creates a black background image
#line5 reverses all images so that the text image is used a mask
#line6 composites the black and texture image using the text image as a mask

Code: Select all

convert -background black -gravity center -fill white -pointsize 104 \
-font Arial label:"Votre Texte" -alpha off \
\( -clone 0 -tile 134667texturefabric.gif -draw 'color 0,0 reset' \) \
\( -clone 0 -fill black -colorize 100% \) \
-reverse -compose over -composite \
textured_text.jpg
Image


If the latter, then


#line1-2 creates white text on black background
#line3 creates a white background image
#line4 tiles your texture image to the same size
#line5 reverses all images so that the text image is used a mask
#line6 composites the white and texture image using the text image as a mask
convert -background black -gravity center -fill white -pointsize 104 \
-font Arial label:"Votre Texte" -alpha off \
\( -clone 0 -fill white -colorize 100% \) \
\( -clone 0 -tile 134667texturefabric.gif -draw 'color 0,0 reset' \) \
-reverse -compose over -composite \
textured_background.jpg
Image


To colorize your texture as text:

Code: Select all

convert -background black -gravity center -fill white -pointsize 104 \
-font Arial label:"Votre Texte" -alpha off \
\( -clone 0 -tile 134667texturefabric.gif -draw 'color 0,0 reset' -fill red -colorize 50% \) \
\( -clone 0 -fill black -colorize 100% \) \
-reverse -compose over -composite \
textured_text2.jpg
Image


The rest is adding adding shadows (shadow), trimming (-trim), adding borders (-border, -splice) and extending (-extent) the background color or compositing over a larger text image (-compose over -composite). See the links I presented above.
Post Reply