Undercolor spacing between lines in a caption

Questions and postings pertaining to the usage of ImageMagick regardless of the interface. This includes the command-line utilities, as well as the C and C++ APIs. Usage questions are like "How do I use ImageMagick to create drop shadows?".
Post Reply
jed
Posts: 3
Joined: 2019-06-05T12:06:20-07:00
Authentication code: 1152

Undercolor spacing between lines in a caption

Post by jed » 2019-06-05T12:27:08-07:00

I've been trying to recreate this image with the space between lines where the undercolor separates (arrows for emphasis). Is this possible ImageMagick? I've searched for solutions but it appears if I increase the interline-spacing it just spreads the undercolor to fill the space. The text length often varies so I'm utilizing caption to autofill the space.

Image

User avatar
fmw42
Posts: 25121
Joined: 2007-07-02T17:14:51-07:00
Authentication code: 1152
Location: Sunnyvale, California, USA

Re: Undercolor spacing between lines in a caption

Post by fmw42 » 2019-06-05T14:35:41-07:00

Use label: to create each line as a separate image, then composite them as desired with space between them. Or write text with -annotate, one annotate at a time with spacing adjusted using the offset arguments.

Caption make one image from all text. So the underfloor will be under all of it even with interline-spacing.

jed
Posts: 3
Joined: 2019-06-05T12:06:20-07:00
Authentication code: 1152

Re: Undercolor spacing between lines in a caption

Post by jed » 2019-06-06T08:07:08-07:00

Thank you, I had hoped there might be solution via caption since, in my tests - a thin line does appear within the undercolor. The text will vary regularly so the auto formatting of caption is being leveraged - I had just hoped to capture that aspect of the aesthetic.

User avatar
fmw42
Posts: 25121
Joined: 2007-07-02T17:14:51-07:00
Authentication code: 1152
Location: Sunnyvale, California, USA

Re: Undercolor spacing between lines in a caption

Post by fmw42 » 2019-06-06T09:42:19-07:00

If you are willing to use new lines, such as, caption:"Some Text\n\n Some Text", then you can have spaces between lines that do not have the undercolor.

jed
Posts: 3
Joined: 2019-06-05T12:06:20-07:00
Authentication code: 1152

Re: Undercolor spacing between lines in a caption

Post by jed » 2019-06-08T11:10:38-07:00

Thanks, that's a great idea, though I'm likely going to settle for not having it exact to make it simpler to depend on the simple processing that caption allows. I'm taking variable length titles and generating images to be used as thumbnails. Sadly I discovered that caption isn't available via the path I'd hoped to use via this library wrapper: https://cran.r-project.org/web/packages ... ing_magick

Post Reply