Text with reapeated background?

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
agriz
Posts: 237
Joined: 2011-10-01T02:21:30-07:00
Authentication code: 8675308

Text with reapeated background?

Post by agriz »

Hi,

There will be few lines of text (variable lengths)
If i have a background image with fixed width, how can i use the text to extend that background to create an image?
User avatar
fmw42
Posts: 25562
Joined: 2007-07-02T17:14:51-07:00
Authentication code: 1152
Location: Sunnyvale, California, USA

Re: Text with reapeated background?

Post by fmw42 »

agriz wrote:Hi,

There will be few lines of text (variable lengths)
If i have a background image with fixed width, how can i use the text to extend that background to create an image?

I am not really sure what you are asking to do. Can you provide links to an example of your data?

In the meantime, look at -extent to expand the background of any image to a larger canvas? see http://www.imagemagick.org/Usage/crop/#extent

Or perhaps you want to tile out the text? see http://www.imagemagick.org/Usage/canvas/#tile
agriz
Posts: 237
Joined: 2011-10-01T02:21:30-07:00
Authentication code: 8675308

Re: Text with reapeated background?

Post by agriz »

I want to tile. I will explain it in detail

Code: Select all

convert -background gray -gravity center -fill blue -font Ravie -pointsize 24 -size 360x caption:'test\ntest\ntest' image.jpg
I use this code.

* I have an background image with 100*100 size
* I want to tile that image while creating text (image).

The above code works for any length text. I want to now tile an background image instead of background color.

How to do it?

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

Re: Text with reapeated background?

Post by fmw42 »

You cannot tile a background image until you know how big your text image is going to be. So you need to separate the steps or create a step that finds out how big the text image will be and then recreate the tiled background with that size and then overlay the text on it.

See the "Get Wet" example at http://www.imagemagick.org/Usage/text/#annotate_size

That is probably what you want to do.

Alternately, see the examples at http://www.imagemagick.org/Usage/compose/#tile These are bit more straightforward.

In any case you can see what is being done by inserting -write tmpX.png after each important step and track the progress and what happens by looking at the tmpX.png images.
agriz
Posts: 237
Joined: 2011-10-01T02:21:30-07:00
Authentication code: 8675308

Re: Text with reapeated background?

Post by agriz »

I will check out those example and let you know today
Post Reply