2

I am wanting to use imagemagick to add watermarks to photographs. I am using OSX and Python scripts for the code and was trying the code from (http://www.imagemagick.org/Usage/text/#pango_markup) currently I am struggling to understand why I can't get the images to appear.

serinitus:nppPhotos ns$ convert -background lightblue -gravity center -size 180x \
>           pango:"The <b>bold</b> and <i>beautiful</i>" \
>           pango_formatting.gif
convert: unable to open image `The <b>bold</b> and <i>beautiful</i>': No such file or directory @ error/blob.c/OpenBlob/2658.
convert: no decode delegate for this image format `PANGO' @ error/constitute.c/ReadImage/501.
convert: no images defined `pango_formatting.gif' @error/convert.c/ConvertImageCommand/3187.
serinitus:nppPhotos ns$   

Installed versions are ImageMagick 6.8.9-7 Q16 x86_64 2014-09-14 and pango-1.36.7 via homebrew.

I have tried re-installing ImageMagick with the --with-pango flag.

I'm down to one of two options: I'm missing something really obvious with the command line (even thought I copied/pasted it in), or there is a config error with the way that brew is installing imagemagick on OSX Lion.

Neil Stoker
  • 284
  • 3
  • 16

4 Answers4

7

I made it work with the following commands on El Capitan: brew update

brew uninstall --force pango

brew rm gobject-introspection

brew deps imagemagick --with-pango

brew install imagemagick --build-from-source --with-pango
Mogsdad
  • 44,709
  • 21
  • 151
  • 275
gogo52cn
  • 79
  • 1
  • 2
5

It looks to me as though Pango is not installed. Either of the following two commands will tell you if ImageMagick is aware of Pango:

convert -list format
identify -list format

Output:

Format  Module    Mode  Description
-------------------------------------------------------------------------------
  3FR  DNG       r--   Hasselblad CFV/H3D39II
  AAI* AAI       rw+   AAI Dune image
   AI  PDF       rw-   Adobe Illustrator CS2
  ART* ART       rw-   PFS: 1st Publisher Clip Art
  ARW  DNG       r--   Sony Alpha Raw Image Format
  AVI  MPEG      r--   Microsoft Audio/Visual Interleaved
  AVS* AVS       rw+   AVS X image
  BGR* BGR       rw+   Raw blue, green, and red samples
 BGRA* BGR       rw+   Raw blue, green, red, and alpha samples
  BMP* BMP       rw-   Microsoft Windows bitmap image
  ...
  PAM* PNM       rw+   Common 2-dimensional bitmap format
PANGO* PANGO     ---   Pango Markup Language

Or, if you dislike looking through lists:

identify -list format | grep -Ei "Description|pango"

Format  Module    Mode  Description
 PANGO* PANGO     ---   Pango Markup Language

You are looking for an r for read and a w for write in the column headed Mode. As you can see, nor do I have Pango :-)

Mark Setchell
  • 191,897
  • 31
  • 273
  • 432
2

brew install imagemagick --build-from-source --with-pango

Doesn't work anymore, the options have been removed, github issue for reference https://github.com/Homebrew/homebrew-core/issues/31510

They might reimplement the option if someones comes up with a good solution

In the meantime you can try this

brew install imagemagick
brew install pango librsvg
brew install cairo --build-from-source

If you already have the packages installed try brew reinstall package_name

Immutable Brick
  • 830
  • 12
  • 23
1

None of the above worked for me (on Catalina), but it worked via macports (thanks to https://east.fm/posts/imagemagick-pango/index.html): sudo port install imagemagick +pango.

agatheblues
  • 229
  • 1
  • 10