Page 1 of 1

Crop Label width

Posted: 2016-11-24T01:38:48-07:00
by utbl
I want to crop the label / text width in this command:

convert -background none -bordercolor none -gravity west
1.png label:"1" +swap -append label:"text 1" -append -write miff:- +delete
2.png label:"2" +swap -append label:"text 2" -append -write miff:- +delete
3.png label:"3" +swap -append label:"text 3" -append -write miff:- +delete
4.png label:"4" +swap -append label:"text 4" -append -write miff:- +delete
5.png label:"5" +swap -append label:"text 5" -append -write miff:- +delete
6.png label:"6" +swap -append label:"text 6" -append miff:- | montage -set label "" miff:-
-background pink -tile 3x2 -geometry +15+5 result.png

the command creates me an image nearly like this one: https://i.stack.imgur.com/uipMc.png

Re: Crop Label width

Posted: 2016-11-24T12:33:30-07:00
by fmw42
I am not sure what you want to crop. Can you be more specific? Is it the part marked LOGO?

That is an incorrect command. First there is no label specified in your command. You probably mean -title "Logo" rather than -set label ""

If you do something like this (unix syntax) and add -debug annotate, you will get the information about the text being created.

Code: Select all

convert -background none -bordercolor none -gravity west \
rose:  label:"1" +swap -append label:"text 1" -append -write miff:- +delete \
rose:  label:"2" +swap -append label:"text 2" -append -write miff:- +delete \
rose:  label:"3" +swap -append label:"text 3" -append -write miff:- +delete \
rose:  label:"4" +swap -append label:"text 4" -append -write miff:- +delete \
rose:  label:"5" +swap -append label:"text 5" -append -write miff:- +delete \
rose:  label:"6" +swap -append label:"text 6" -append miff:- |\
montage -debug annotate -title "TEST" miff:- -background pink -tile 3x2 -geometry +15+5 result.png
...
Metrics: text: TEST; width: 62; height: 28; ascent: 22; descent: -5; max advance: 48; bounds: 0.5625,-0.078125 14.1875,18; origin: 62,0; pixels per em: 24,24; underline position: -4.5625; underline thickness: 2.34375
2016-11-24T11:31:56-08:00 0:00.590 0.050u 6.9.6 Annotate montage[477]: annotate.c/RenderFreetype/1418/Annotate
Font /Library/Fonts/Arial.ttf; font-encoding none; text-encoding none; pointsize 24
2016-11-24T11:31:56-08:00 0:00.590 0.060u 6.9.6 Annotate montage[477]: annotate.c/RenderFreetype/1418/Annotate
Font /Library/Fonts/Arial.ttf; font-encoding none; text-encoding none; pointsize 12
2016-11-24T11:31:56-08:00 0:00.590 0.060u 6.9.6 Annotate montage[477]: annotate.c/GetTypeMetrics/838/Annotate
...




Please always provide your IM version and platform, since syntax may differ.

Re: Crop Label width

Posted: 2016-12-01T03:10:13-07:00
by utbl
Sorry for that late reply I want to crop the label / text width.

My IM version: ImageMagick 6.9.3-7 Q16 x64 2016-03-06 http://www.imagemagick.org

OS: Windows 10