Page 1 of 1

Gravity won't work properly

Posted: 2015-02-01T11:33:11-07:00
by bdg
Hi

Have some issues with my montage of 4 images. They are colums that have differnt highs depending on weather conditions.

At first it worked ok, but at some point, after a reinstall i think, they are suddenly aligned at the top. Se the actual image added to the webcam image here:
http://selevaret.casadelsele.com/wxwebcam.php

Code: Select all

montage \
-label $rain_1h_label $rain_1h_file \
-label $rain_24h_label $rain_24h_file \
-label $temp_label $temp_file \
-label $wind_label $wind_file \
-background none \
-font '/home/selevaret/public_html/images/cb/arial.ttf' \
-fill 'yellow' \
-pointsize 15 \
-gravity south \
-geometry +2+2 \
-tile 4x1 tmp.gif

mv tmp.gif $outfile

Re: Gravity won't work properly

Posted: 2015-02-01T13:38:25-07:00
by fmw42
I do not see any input images in your command

Re: Gravity won't work properly

Posted: 2015-02-01T14:35:41-07:00
by bdg
Input images is in the label in a variable... that variable contains the filename.

Re: Gravity won't work properly

Posted: 2015-02-01T15:40:38-07:00
by fmw42
As far as I know, there has always been an issue with -gravity in montage. All the images are north justified, except the very last one, no matter what gravity you set.

Try these experiments:

Code: Select all

convert -respect-parenthesis logo: \
\( -clone 0 -resize 10% -write tmp1.png \) \
\( -clone 0 -resize 30% -write tmp2.png \) \
\( -clone 0 -resize 40% -write tmp3.png \) \
\( -clone 0 -resize 20% -write tmp4.png \) \
-delete 0 null:

Code: Select all

montage tmp1.png tmp2.png tmp3.png tmp4.png -gravity south -background black -geometry +2+2 -tile 4x1 result_south.png

Code: Select all

montage tmp1.png tmp2.png tmp3.png tmp4.png -gravity north -background black -geometry +2+2 -tile 4x1 result_north.png
This is a workaround for gravity south:

Code: Select all

convert tmp1.png tmp2.png tmp3.png tmp4.png -flip miff:- |\
montage - -gravity north -background black -geometry +2+2 -tile 4x1 miff:- | convert - -flip result_south_good.png
I tested several versions of IM back to 6788 and they all have the same issue.

Re: Gravity won't work properly

Posted: 2015-02-03T02:35:35-07:00
by bdg
Thanx. will try to explore these options:)

Re: Gravity won't work properly

Posted: 2015-02-10T08:56:41-07:00
by bdg
Solved it by using convert and +append. And made the labels on a seperate image and added thet with -append:)