Text outline issue with new IM version
Posted: 2016-05-05T13:23:43-07:00
I apologize if this has been discussed before, but I couldn't find any pointers here in the forum. I'm using IM on Raspbian (on Pi) but see the same behavior on Xubuntu PC as well. I've been using this code for a text watermark (white text with black outline for good readability in changing light conditions) for webcam images for quite some time with IM 6.7.7-10:
After a recent crash and a fresh reinstall, the version of IM that apt-get gives me is 6.8.9-9 and same code suddenly behaves differently - it seems as if it calculated the box size of the text including the outline, so as a result, the black text that acts as the outline is offset to the left (as is white when compared to the previous versions).
I could work around this by adjusting the offset like this:
So there's a workaround. But I'm not sure - was 6.7.7-10 buggy? Or did 6.8.9-9 introduce a bug? Or am I doing this completely wrong? Thanks for any guidance in advance!
Code: Select all
text="Some Sample Text"
convert $1 -gravity southeast -pointsize 40 \
-stroke black -strokewidth 4 -annotate +10+5 "${text}" \
-stroke white -strokewidth 1 -fill white -annotate +10+5 "${text}" \
"out.jpg"
I could work around this by adjusting the offset like this:
Code: Select all
text="Some Sample Text"
convert $1 -gravity southeast -pointsize 40 \
-stroke black -strokewidth 4 -annotate +6+5 "${text}" \
-stroke white -strokewidth 1 -fill white -annotate +9+5 "${text}" \
"out.jpg"