Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8022661
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 4, 20262026-06-04T22:19:44+00:00 2026-06-04T22:19:44+00:00

I am trying to place a caption with a semi-transparent background on an image.

  • 0

I am trying to place a caption with a semi-transparent background on an image.

This is the example from the docs (http://www.imagemagick.org/Usage/annotating):

width=`identify -format %w dragon.gif`; \
convert -background '#0008' -fill white -gravity center -size ${width}x30 \
      caption:"Faerie Dragons love hot apple pies\!" \
      dragon.gif +swap -gravity south -composite  anno_caption.jpg

enter image description here

This my attempt so far:

convert  -background transparent -colorspace transparent -fill white -gravity center -size 300x300 \
      -font fonts/customfont.ttf caption:'caption text here' \
       'cap.png'

composite -geometry +0+0 'cap_1.png' 'img_1.jpg' 'img_2.jpg'

the caption is created an placed in the top right hand coner of the composite image as expected. The only problem is, the caption background is black, not semi-transparent. I have seen the use of the xc command for transparency (e.g. convert -size 50×50 xc:’#879′ img.png) but I do not see how to apply the command to set the caption bg colour.

EDIT:

I just tested on an ec2 server and the code works as expected. This issue occurs when the code is run on a Mac 10.7x.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-04T22:19:46+00:00Added an answer on June 4, 2026 at 10:19 pm

    Give this a go – it is using rgb with transparency ( rgba ).

    convert -size 300x300 -background rgba\(0,255,255,0.25\) -fill white -gravity center caption:'caption text here' cap.png
    
    composite -geometry +0+0 cap.png img_1.jpg img_2.jpg
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I am trying to place a repeating gradient .png as a background-image for a
I am trying to place a value (from an object) in a variable and
I'm trying to place a nice border around an image that's 250x250, using only
I was trying to place some simple effects on an image using HBox using
I am trying to post an image to an album on facebook and place
I'm trying to place multiple markers on a map that are provided from an
I am trying to place some text over a button image. I manage to
I am trying to place text view on image view of particular size, but
I am trying to place the twiter and facebook icons on http://trishtours.firstavenuedesigns.co.uk/ just below
I'm trying to place this menu on the left hand side of the page:

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.