How create persian or arabic text with imgaemagick ?

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?".
User avatar
fmw42
Posts: 25562
Joined: 2007-07-02T17:14:51-07:00
Authentication code: 1152
Location: Sunnyvale, California, USA

Re: How create persian or arabic text with imgaemagick ?

Post by fmw42 »

User snibgo has a good point. But note you will have to install the PANGO delegate library (and possibly reinstall IM) if your system does not already have it. I do not know that much about what is installed with Windows systems.

See http://www.imagemagick.org/Usage/text/#pango for use of PANGO: to create text images.
mostafanastary
Posts: 44
Joined: 2014-11-28T16:19:41-07:00
Authentication code: 6789

Re: How create persian or arabic text with imgaemagick ?

Post by mostafanastary »

my server administrator told me Pango is too old and without new update and maybe not safe or useable .

can i use it or not?
MR. Garcia
Posts: 2
Joined: 2017-06-28T08:37:32-07:00
Authentication code: 1151
Location: Third world
Contact:

Re: How create persian or arabic text with imgaemagick ?

Post by MR. Garcia »

Hi there, and so sorry to bring an old topic up...
How can I use pango to write ON a picture?
I can use it to append a text on top/bottom of a picture, like this:
convert Input.jpg -font Yekan -fill Red -pointsize 20 -gravity Center pango:"تست..." -append Output.jpg

But when I remove the "-append" parameter (to put the text on the center of the image), like this:
convert Input.jpg -font Yekan -fill Red -pointsize 20 -gravity Center pango:"تست..." Output2.jpg
It will create two output files:
Output2-0.jpg which is the same as Input.jpg
and
Output2-1.jpg which is just the text on a white background :/

How can I print that text on the picture?
Thanks in advanced
User avatar
fmw42
Posts: 25562
Joined: 2007-07-02T17:14:51-07:00
Authentication code: 1152
Location: Sunnyvale, California, USA

Re: How create persian or arabic text with imgaemagick ?

Post by fmw42 »

Create and image using pango: that puts text onto a transparent background. The composite the result onto your background image at the location you want. See
http://www.imagemagick.org/Usage/text/#pango
http://www.imagemagick.org/Usage/compose/#compose
http://www.imagemagick.org/Usage/layers/#convert
MR. Garcia
Posts: 2
Joined: 2017-06-28T08:37:32-07:00
Authentication code: 1151
Location: Third world
Contact:

Re: How create persian or arabic text with imgaemagick ?

Post by MR. Garcia »

fmw42 wrote: 2017-06-28T09:55:07-07:00 Create and image using pango: that puts text onto a transparent background. The composite the result onto your background image at the location you want. See
http://www.imagemagick.org/Usage/text/#pango
http://www.imagemagick.org/Usage/compose/#compose
http://www.imagemagick.org/Usage/layers/#convert
Hi again, and THANK YOU for saving my time on this! :)
I'm just gonna paste a simple example of this here, for others maybe:
convert -gravity Center -fill black -font Arial -pointsize 50 -background Transparent pango:"تست!" Persian.png
composite -gravity center Persian.png AnotherPic.jpg Output.jpg
Post Reply