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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 27, 20262026-05-27T22:27:10+00:00 2026-05-27T22:27:10+00:00

Below imagemagick code which works fine by creating RUb with the background color black

  • 0

Below imagemagick code which works fine by creating “RUb” with the background color “black white black” and fonts colors will be in “whiteblack white” colors ..

 exec("convert -size 30x30 xc:white -font verdana.ttf -fill black -pointsize 30 -gravity     center -draw \" text 0,0 'R' \" R.gif");
exec("convert -size 30x30 xc:black -font verdana.ttf -fill white -pointsize 30 -gravity  center -draw \" text 0,0 'u' \" u.gif");
exec("convert -size 30x30 xc:white -font verdana.ttf -fill black -pointsize 30 -gravity center -draw \" text 0,0 'b' \" b.gif");
exec("convert -background white -bordercolor black -border 1 -gravity center R.gif u.gif  b.gif +append text_bw.jpg");

But now i need to use variables for “fonts color” , “label” and “background color” ..how to do that????ex: if i want to create “rub” i need only one variable “$label” not “$label1 , $label2 $label3” … is there a way to do?? if yes can any please help me with sample code/ example with refrence to the above code..

  • 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-05-27T22:27:11+00:00Added an answer on May 27, 2026 at 10:27 pm

    Something like this? (bit messy but it’s a start)

    $label = 'rub';
    $images = array();
    for ($i = 0; $i < strlen($label); $i++) {
        $letter = $label[$i];
        $image = $letter . '.gif';
        exec("convert -size 30x30 xc:black -font verdana.ttf -fill white -pointsize 30 -gravity  center -draw \" text 0,0 '{$letter}' \" {$image}");
        $images[] = $image;
    }
    $images = implode(' ', $images);
    exec("convert -background white -bordercolor black -border 1 -gravity center {$images} +append text_bw.jpg");
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Below is my validations for image content type which works fine. validates_attachment_size :icon, :less_than
Below is my code that works fine on IE 8 but it doesn't work
Below I have a Json function and some php code which it retrieves. JavaScript
Below script will downlaod the facebook sdk to generate the code to create the
I am trying to generate images using ImageMagick, please check the code below: <?
Below code works well, its able to replace any tag it find with a
Below is code for a dojo Dialog that will pop up to enable the
Below is part of the XML which I am processing with PHP's XSLTProcessor :
Below is the code of a simple html with a table layout. In FF
Below is the code that I am writing in HTML and I'm getting what

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.