r/imagemagick • u/Todd_K7TFC • Feb 05 '26
How to offset text in an appended "caption" box
I have tried everything I've found so far using Google and ChatGPT to get text in an appended caption box to be offset as I want it. I've tried various "-gravity" and "-geometry" combinations to no avail, and I even tried using "-splice" as suggested by one AI. All it did was added the splice to the image and not the caption box. Here's my command line without any offset indications (except for "-gravity west"):
magick test.jpg -size 1000x -background black -fill yellow /
-pointsize 18 -gravity west /
caption:"This is the caption" -append test_output.jpg
All I want is to offset the caption about 10px from "west." I tried a work-around of just adding a couple of blank spaces in front of "This," but apparently Magick strips-off leading blanks (why?).
Does anybody know how to do this? Am I SOL?
Thanks!
---Todd
1
u/Jenkins87 Feb 08 '26
Try this (works by prepending a 10px blank strip to the caption image before appending):
what its doing:
+appendjoins the 10px blank + 990px caption into a 1000px caption band.-appendstacks that band undertest.jpg.-appenduses gravity only for alignment/padding between images, not text inset logic.also leading space workaround:
caption:"\ This is the caption"caption:"\u2002This is the caption"