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 104231
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 11, 20262026-05-11T01:14:56+00:00 2026-05-11T01:14:56+00:00

I need to batch create images with text. Requirements: arbitrary size of bitmap PNG

  • 0

I need to batch create images with text. Requirements:

  1. arbitrary size of bitmap
  2. PNG format
  3. transparent background
  4. black text anti-aliased against transparency
  5. adjustable character spacing
  6. adjustable text position (x and y coordinates where text begins)
  7. TrueType and/or Type1 support
  8. Unix command line tool or Python library

So far I’ve evaluated the following:

  • Python Imaging Library: fails 5.
  • ImageMagick (‘caption’ option): hard to figure out 6.
  • PyCairo: fails 5.
  • SVG + ImageMagick convert: most promising, although requires multiple tools

The problem with PIL is that e.g. the default spacing for Verdana is way too sparse. I need the text to be a bit tighter, but there’s no way to adjust it in PIL.

In ImageMagick I haven’t found an easy way to specify where in the image the text begins (I’m using -size WIDTHxHEIGHT and caption:’TEXT’). Adding a transparent border will move the text away from the corner it’s achored to, but

  • image size needs to be adjusted accordingly since border adds to the extents
  • it’s not possible to adjust horizontal and vertical offset independently

Have I missed some obvious alternatives or failed to find necessary features from the above mentioned?

  • 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. 2026-05-11T01:14:57+00:00Added an answer on May 11, 2026 at 1:14 am

    Here’s the SVG + ImageMagick solution:

    Programmatically create SVG documents based on this template, replacing ‘TEXT HERE’ with the desired text content:

    <?xml version='1.0' encoding='UTF-8' ?> <!DOCTYPE svg PUBLIC       '-//W3C//DTD SVG 1.0//EN'       'http://www.w3.org/TR/2001/REC-SVG-20010904/DTD/svg10.dtd'> <svg version='1.0' width='152px' height='50px'>   <text style='font-size: 22px; font-weight:bold; font-family: Verdana-Bold;                letter-spacing: -1.3%;'>     <tspan x='10' y='39'>TEXT HERE</tspan>   </text> </svg> 

    Convert the documents to background-transparent PNGs with ImageMagick’s convert:

    $ convert -background none input.svg output.png 
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have a batch file that creates a scheduled task using schtasks like this:
A wrong percentage has been applied to a field (TotalPercentageAmount) and I need to
I am upsizing the back end of a client's Access app tomorrow and need
when we use Expires header for text files like js, css, contents are cached
Is it possible to pass parameters to a SQL Server script? I have a
I have a table in a central database that gets constantly appended to. I
This should be simple. Question How do you get a pointcut in one project
I wanted to get the community's feedback on a language choice our team is
I have a MEF based solution that has several exported implementations of an interface.
This is an organizational question - I have a set of Java Projects within

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.