Imagemagick Draw text, draws past the border of the image. How to fix?
<p>When I use Imagemagick's draw function to write text it will write beyond the border of the image. For example if the image is 200px width and the text I need to write will take up 300px, it continues off the edge and the rest of the text isn't shown.</p>

<p>I checked the manual and didnt find anything on how to set some type of constraint for it to stay within. Any ideas?</p>

<p>If you have a known area which you want to put text in, you should probably use <code>caption:</code> and not specify a font size, then ImageMagick will use the largest font commensurate with that size:</p>

<pre><code>convert -size 200x100 -background blue -fill white caption:"Here is some funky text." result.png
</code></pre>

<p>See also <a href="http://stackoverflow.com/a/39557083/2836621/">here</a>.</p>

python image imagemagick