Page 1 of 1
Centering the Label of an Image doesn't work
Posted: 2017-11-27T02:55:31-07:00
by laocoon
Hey,
I'm having a problem with labeling an Image. I want to lower the label a little bit, so it sits nice in the center of the "label-box" (canvas?). I tried almost every example on the ImageMagick Text-Handling page (
http://www.imagemagick.org/Usage/text/#label), but couldn't get it working.
So here is the code I'm using:
Code: Select all
montage \
-label "WEIHNACHTSFEIER CINEMAXX 2017" path/to/the/image.jpg \
-gravity center \
-font Times-Bold \
-pointsize 170 \
-fill DeepPink \
-geometry +0+0 \
-background black /home/pi/temp.jpg
This is what i get as an output:
I want the label to sit a bit lower, so it is in the middle of the black background.
Thanks for your help!
Re: Centering the Label of an Image doesn't work
Posted: 2017-11-27T04:10:27-07:00
by snibgo
What version of IM? If older than 6.9, I suggest you upgrade.
Re: Centering the Label of an Image doesn't work
Posted: 2017-11-27T06:52:59-07:00
by laocoon
Thanks for the fast reply.
I had 6.8 installed, now i updated to 6.9.9.23 but my scripts aren't working anymore. Now i get the following Error:
Code: Select all
montage: no decode delegate for this image format 'JPEG' @error/constitute.c/ReadImage504.
montage: missing an image filename '/home/pi/temp.jpg' @error/montage.c/MontageImageCommand/1793.
I ran sudo make check before and it seemed like everything was ok. What is the problem now?
Re: Centering the Label of an Image doesn't work
Posted: 2017-11-27T07:56:51-07:00
by snibgo
laocoon wrote:no decode delegate for this image format 'JPEG'
If it can't read JPEGs, that suggests a serious problem. What happens with:
Code: Select all
convert -list version
convert rose: r.jpg
convert r.jpg r2.jpg
convert rose: r.png
convert r.png r2.png
They should all work. Please paste the text output from "convert -list version". It should be something like:
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
If you don't have delegates, that's the problem. How did you install? Did you build from source, without building delegates first?
Re: Centering the Label of an Image doesn't work
Posted: 2017-11-27T08:40:29-07:00
by laocoon
leads to following output:
Code: Select all
convert: unrecognized list type 'version' @ error/convert.c/ConvertImageCommand/2053
the rest of the commands you posted are working now.
I installed in the following way after downloading and unzipping:
Code: Select all
cd ImageMagick-*
sudo ./configure
sudo make
sudo make install
after that i researched on the delegate topic and downloaded from imagemagick/download/delegate/jpeg-9b, ran the same process with jpeg-9b and than reran the installation of imagemagick. Now I get no errors anymore, but the label isn't moving either, still keeps on the top of the black box.
When I type
I get:
Code: Select all
Version: ImageMagick 6.9.9-23 Q16 arme 2017-11-27
Copyright:....
License: ....
Features: Cipher DPC OpenMP
Delegates (built-in): freestyle jpg jpeg png zlib
Thanks for your help so far! Do you have any suggestions why the label isn't moving?
Re: Centering the Label of an Image doesn't work
Posted: 2017-11-27T09:35:11-07:00
by snibgo
I don't know. With v6.9.5-3, I get:
Code: Select all
montage \
-label "WEIHNACHTSFEIER CINEMAXX 2017" toes.png \
-gravity center \
-font Times-New-Roman-Bold \
-pointsize 170 \
-fill DeepPink \
-geometry +0+0 \
-background black out.jpg
My image is too small for the text, but it spaces correctly. -label "W" gives:
Maybe there is a problem with your font. Do other fonts work correctly?
Re: Centering the Label of an Image doesn't work
Posted: 2017-11-27T11:07:44-07:00
by fmw42
Delegates (built-in): freestyle jpg jpeg png zlib
You need fontconfig to use font names and the font needs to be in your type.xml file. Otherwise, use the path to the font file itself with suffix.
I suggest you re-install but before you do, make sure you have installed all the delegates you need such as PNG, Ghostscript, etc. See snigbo's list for example.
What is your platform and how did you install ImageMagick?