Page 1 of 1

Text with reapeated background?

Posted: 2011-11-05T04:08:28-07:00
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?

Re: Text with reapeated background?

Posted: 2011-11-05T10:19:56-07:00
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

Re: Text with reapeated background?

Posted: 2011-11-05T10:32:14-07:00
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

Re: Text with reapeated background?

Posted: 2011-11-05T12:37:03-07:00
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.

Re: Text with reapeated background?

Posted: 2011-11-05T19:28:12-07:00
by agriz
I will check out those example and let you know today