Replicating montage label example

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
chriscox
Posts: 2
Joined: 2019-06-27T12:11:37-07:00
Authentication code: 1152

Replicating montage label example

Post by chriscox »

Hi all,
I have been wrestling with montage, trying to label each constituent image so that that the label is printed completely below the image. I am very green when it comes to imagemagick... the example made it look simple enough:

Code: Select all

  montage -label Balloon   balloon.gif  \
          -label Medical   medical.gif  \
          \( present.gif  -set label Present  \) \
          \( shading.gif  -set label Shading  \) \
          -tile x1  -frame 5  -geometry '60x60+2+2>' \
          -title 'My Images'     titled.jpg
Which, according to the montage Usage page, should produce:

Image

However, when I download the images (from http://www.imagemagick.org/Usage/images/) and run the code on my own system (Fedora release 29, Intel Core i7-6700 CPU @ 3.40GHz × 8, AMD Oland GPU), I get the following:

Image

In the example image, the label text is nicely accommodated. In my image, the label text is printed on top of the images somewhat. Also, in my version, the title has not printed. I have played around with -geometry and -frame and -border but haven't been able to replicate the output the code should have provided (according to the published example). Does anyone have suggestions? Been beating my head against this for hours... Thank you!

My ImageMagick version details are below.

Code: Select all

$ convert --version
Version: ImageMagick 6.9.9-38 Q16 x86_64 2018-07-12 http://www.imagemagick.org
Copyright: © 1999-2018 ImageMagick Studio LLC
License: http://www.imagemagick.org/script/license.php
Features: Cipher DPC Modules OpenMP 
Delegates (built-in): bzlib cairo djvu fftw fontconfig freetype gslib jbig jng jp2 jpeg lcms ltdl lzma openexr pangocairo png ps rsvg tiff webp wmf x xml zlib
PS: I tried compiling the latest source (I didn't want to install the pre-compiled RPM bundle for fear of it interfering with my package-managed installation) but it doesn't seem to be building in any of the "decode delegates":

Code: Select all

[chriscox@HS-PSYC-839XF32 ImageMagick-7.0.8-50]$ ./magick.sh  montage \
    -label Balloon   balloon.gif \
    -label Medical   medical.gif \
    \( present.gif  -set label Present  \) \
    \( shading.gif  -set label Shading  \) \
    -tile x1  -frame 5  -geometry '60x60+2+2>' \
    -title 'My Images' \
    titled.jpg

montage: no decode delegate for this image format `GIF' @ error/constitute.c/ReadImage/504.
montage: missing an image filename `titled.jpg' @ error/montage.c/MontageImageCommand/1795.

Code: Select all

[chriscox@HS-PSYC-839XF32 ImageMagick-7.0.8-50]$ ./magick.sh montage -list format
   Format  Module    Mode  Description
-------------------------------------------------------------------------------

* native blob support
r read support
w write support
+ support for multiple images
User avatar
fmw42
Posts: 25562
Joined: 2007-07-02T17:14:51-07:00
Authentication code: 1152
Location: Sunnyvale, California, USA

Re: Replicating montage label example

Post by fmw42 »

IM 6.9.9.38 is rather old. Perhaps it has a bug. You might try upgrading to a more current version of IM 6 or as you tried IM 7. Sorry, I do not use Linux and so cannot help with the installation.
chriscox
Posts: 2
Joined: 2019-06-27T12:11:37-07:00
Authentication code: 1152

Re: Replicating montage label example

Post by chriscox »

Thanks for the reply! IM 6.9.9.38 is the most current version in the Fedora 29 repos. Is there an alternative repository that I should be installing from, or do you just have to install from source/RPMs from outside the scope of the package manager?
User avatar
fmw42
Posts: 25562
Joined: 2007-07-02T17:14:51-07:00
Authentication code: 1152
Location: Sunnyvale, California, USA

Re: Replicating montage label example

Post by fmw42 »

I testest with 6.9.9.38 on Mac OSX Sierra and got the correct result. So I suspect that your Linux distro has a bad or insufficiently patched version. What is your version of libjpeg? If not current then perhaps that is the issue. Try output to GIF. Does that fix it?
Post Reply