Not able to draw text on image

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
him21sri
Posts: 36
Joined: 2016-05-19T05:27:37-07:00
Authentication code: 1151

Not able to draw text on image

Post by him21sri »

I want to draw some text over an image and I am trying to that in the below manner :

DrawAnnotation(d_wand,10,10,"Magick");
MagickDrawImage(wand,d_wand);

But I am getting below error :

delegate library support not built-in `none' (Freetype) @ warning/annotate.c/RenderFreetype/1533.
delegate library support not built-in `none' (Freetype) @ warning/annotate.c/RenderFreetype/1533.

Any help is appreciated.
snibgo
Posts: 12159
Joined: 2010-01-23T23:01:33-07:00
Authentication code: 1151
Location: England, UK

Re: Not able to draw text on image

Post by snibgo »

So your IM probably doesn't have freetype. What does "convert -version" say? It should be something like this:

Code: Select all

Version: ImageMagick 6.9.5-3 Q16 x86 2016-07-22 http://www.imagemagick.org
Copyright: Copyright (C) 1999-2015 ImageMagick Studio LLC
License: http://www.imagemagick.org/script/license.php
Visual C++: 180040629
Features: Cipher DPC Modules OpenMP
Delegates (built-in): bzlib cairo flif freetype jng jp2 jpeg lcms lqr openexr pangocairo png ps rsvg tiff webp xml zlib
snibgo's IM pages: im.snibgo.com
him21sri
Posts: 36
Joined: 2016-05-19T05:27:37-07:00
Authentication code: 1151

Re: Not able to draw text on image

Post by him21sri »

yes my imageMagick do not have freetype

convert --version
Version: ImageMagick 6.8.9-10 Q16 x86_64 2017-04-07 http://www.imagemagick.org
Copyright: Copyright (C) 1999-2014 ImageMagick Studio LLC
Features: DPC OpenMP
Delegates: bzlib jng jpeg png zlib


Can you please point me to the link from where I can download and install the same
snibgo
Posts: 12159
Joined: 2010-01-23T23:01:33-07:00
Authentication code: 1151
Location: England, UK

Re: Not able to draw text on image

Post by snibgo »

You are also missing delegates such as png and tiff. I suggest you reinstall or rebuild IM.
snibgo's IM pages: im.snibgo.com
him21sri
Posts: 36
Joined: 2016-05-19T05:27:37-07:00
Authentication code: 1151

Re: Not able to draw text on image

Post by him21sri »

Thank you, Installed a fresh ImageMagick and all delegates were present. I am able to draw text over an image now.

I have another problem, I want to add padding to the image on the sides, for this I am using MagickExtentImage API where I will provide the offset where the image will be placed and on the side padding comes. Currently the padding is in white color, can I somehow make this transparent.
snibgo
Posts: 12159
Joined: 2010-01-23T23:01:33-07:00
Authentication code: 1151
Location: England, UK

Re: Not able to draw text on image

Post by snibgo »

Use a background of "none" (which is fully transparent black).
snibgo's IM pages: im.snibgo.com
Post Reply