Juergen Schulze
Juergen Schulze

Reputation: 1652

imagemagick: append label, gravity buggy

I was trying to reproduce the hint in

imagemagick: append a label under image with font size

This is my source image:

enter image description here

convert red.png -pointsize 36 label:"Test label" -gravity center -append red2.png

But instead of the expected result (label placed on bottom centered) I got this

enter image description here

I don't think that imagemagick has a bug. So, what am I doing wrong?

Here the version's info

convert -version

GraphicsMagick 1.4 snapshot-20181020 Q16 http://www.GraphicsMagick.org/ Copyright (C) 2002-2018 GraphicsMagick Group. Additional copyrights and licenses apply to this software. See http://www.GraphicsMagick.org/www/Copyright.html for details.

Feature Support: Native Thread Safe yes Large Files (> 32 bit) yes Large Memory (> 32 bit) yes BZIP
yes DPS no FlashPix no
FreeType yes Ghostscript (Library) no JBIG
yes JPEG-2000 no JPEG yes
Little CMS yes Loadable Modules no OpenMP
yes (201511) PNG yes TIFF
yes TRIO no UMEM no WebP yes WMF yes X11 yes
XML yes ZLIB yes

Host type: x86_64-pc-linux-gnu

Configured using the command: ./configure '--build' 'x86_64-linux-gnu' '--enable-shared' '--enable-static' '--enable-libtool-verbose' '--prefix=/usr' '--mandir=${prefix}/share/man' '--infodir=${prefix}/share/info' '--docdir=${prefix}/share/doc/graphicsmagick' '--with-gs-font-dir=/usr/share/fonts/type1/gsfonts' '--with-x' '--x-includes=/usr/include/X11' '--x-libraries=/usr/lib/X11' '--without-dps' '--without-modules' '--without-frozenpaths' '--with-webp' '--with-perl' '--with-perl-options=INSTALLDIRS=vendor' '--enable-quantum-library-names' '--with-quantum-depth=16' 'build_alias=x86_64-linux-gnu' 'CFLAGS=-g -O2 -fdebug-prefix-map=/build/graphicsmagick-1.3.30+hg15796=. -fstack-protector-strong -Wformat -Werror=format-security' 'LDFLAGS=-Wl,-z,relro -Wl,-z,now' 'CPPFLAGS=-Wdate-time -D_FORTIFY_SOURCE=2' 'CXXFLAGS=-g -O2 -fdebug-prefix-map=/build/graphicsmagick-1.3.30+hg15796=. -fstack-protector-strong -Wformat -Werror=format-security'

Final Build Parameters: CC = gcc CFLAGS = -fopenmp -g -O2 -fdebug-prefix-map=/build/graphicsmagick-1.3.30+hg15796=. -fstack-protector-strong -Wformat -Werror=format-security -Wall -pthread CPPFLAGS = -Wdate-time -D_FORTIFY_SOURCE=2 -I/usr/include/X11 -I/usr/include/freetype2 -I/usr/include/libxml2 CXX = g++ CXXFLAGS = -g -O2 -fdebug-prefix-map=/build/graphicsmagick-1.3.30+hg15796=. -fstack-protector-strong -Wformat -Werror=format-security -pthread LDFLAGS = -Wl,-z,relro -Wl,-z,now -L/usr/lib/X11 -L/usr/lib/x86_64-linux-gnu LIBS = -ljbig -lwebp -lwebpmux -llcms2 -ltiff -lfreetype -ljpeg -lpng16 -lwmflite -lXext -lSM -lICE -lX11 -llzma -lbz2 -lxml2 -lz -lm -lgomp -lpthread

Upvotes: 2

Views: 180

Answers (2)

fmw42
fmw42

Reputation: 53182

In ImageMagick, label: creates a new image. So you need to append that below your red image. To do that you should use parenthesis processing to create the label: image. It is cleaner to read that way.

convert red.png \( -background white -fill black -pointsize 36 label:"Test label" \) -gravity center -append red2.png


enter image description here

See https://imagemagick.org/Usage/text/#label

Upvotes: 1

Juergen Schulze
Juergen Schulze

Reputation: 1652

Thanks to Mark I was able to spot the error.

It looks like I had GraphicsMagick and ImageMagick installed in parallel and somehow they both seam to interfere each other. I really have no clue.

So I uninstalled GraphicsMagick with all dependencies (which I never used) and reinstalled ImageMagick.

Now it works as it should.

Upvotes: 2

Related Questions