# How to set a image background and tile on page in ConTeXt?

That's it. I want to use a image pattern, let's say this image. But I can't figure how to do this on ConTeXt, 'cause neither `\setupbackgrounds` or `\setupframed` have an option to tile backgrounds. I suppose that could be done with Metapost, but I'm very noob at it... Any help is very appreciated!

-

Use `\backgroundimage` to tile any image. The syntax of this command is

``````\backgroundimage{repeat_type}{width}{height}{content}
``````

where

• `repeat_type` is either `1` (tile both x and y directions), `2` (tile in x direction), or `3` (tile in y direction),

• `width` is a TeX dimension

• `height` is a TeX dimension
• `content` is the material you want to tile

The image is repeated until it equals width and height (if `repeat_type` is `1`) or just the width (if `repeat_type` is 2), or height (if `repeat_type` is 3).

Thus you can use:

``````\defineoverlay
[pattern]
[\backgroundimage{1}{\overlaywidth}{\overlayheight}{\externalfigure[http://www.carolrivello.com/wp-content/themes/v7/imgs/bg.jpg]}]

\setupbackgrounds[page][background=pattern]

\starttext
\input knuth
\stoptext
``````
-
It worked, thank you so much! I never thought the answer were so easy. However, I don't understand why \backgroundimage is not in any manual of ConTeXt... Thanks! –  acidrums4 Aug 29 '12 at 23:52
Because the ConTeXt manual is not exhaustive. You can help with the documentation by adding the above information to the wiki at contextgarden.net –  Aditya Aug 29 '12 at 23:54