> For the complete documentation index, see [llms.txt](https://easy-draw.joemazzone.net/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://easy-draw.joemazzone.net/python/module-reference/text-and-images.md). Agents can also search and read this documentation through its [MCP server](https://easy-draw.joemazzone.net/~gitbook/mcp).

# Text and Images

## Text

`Text(center_xy, text)`

![](https://651142499-files.gitbook.io/~/files/v0/b/gitbook-legacy-files/o/assets%2F-MRAMSGwqRIdQ2ADsTkz%2F-MR_npajpEZf8wpIj8HL%2F-MRaFmdYU9IGnMtLINHu%2Fimage.png?alt=media\&token=d19c999e-dfc5-4ad0-920b-73d86b65957a)

| Property        | Default Value         | Description                                                                                    |
| --------------- | --------------------- | ---------------------------------------------------------------------------------------------- |
| `center_xy`     | REQUIRED (No default) | The center coordinate (x, y) of where to draw the text.                                        |
| `text`          | `""` - empty string   | The text you want to display.                                                                  |
| `color`         | "black"               | RGB tuple color value, hexadecimal color value, or string containing color name can be used.   |
| `font`          | "Arial"               | The font family used for the text. Font must be installed on the computer viewing the drawing. |
| `size`          | 16                    | The font size of the text.                                                                     |
| `bold`          | False                 | When set to True, it bolds the text.                                                           |
| `italic`        | False                 | When set to True, it italicizes the text.                                                      |
| `underline`     | False                 | When set to True, it underlines the text.                                                      |
| `strikethrough` | False                 | When set to True, it strikes-out the text.                                                     |
| `visible`       | True                  | <p>True = Text can be seen.</p><p>False = Text cannot be seen.</p>                             |

Example:

```python
words = easy_draw.Text(
    center_xy = (300,100), 
    text = "I Love Python",  
    color = (0, 200, 50),          # Optional Property
    font = "Times",                # Optional Property
    size = 32,                     # Optional Property
    bold = True,                   # Optional Property
    italic = True,                 # Optional Property
    underline = True,              # Optional Property
    strikethrough = True,          # Optional Property
    visible = True                 # Optional Property
)
```

## Images

First thing that needs to be done to use an image is open it in Easy Draw with the `open_image()` function.

The `open_image()` function requires 1 positional argument - `filename`. The image file should be in the same folder as your program.

```python
pic = easy_draw.open_image("super_cool_image.png")
```

Easy Draw can open `.png`, `.gif`, `.jpg`, `.webp`, `.bmp`, and `.svg` images.

### Images from the Internet

`open_image()` also works with a public image link that starts with `http://` or `https://`.

```python
pic = easy_draw.open_image("https://example.com/cat.png")
```

{% hint style="info" %}
Make sure you copy the image's address (right-click the image and choose "Copy image address"), not the web page's address.

The browser loads the image straight from the link, so viewing the drawing needs an internet connection.
{% endhint %}

### Drawing the Image

Then you can create an image object.

`Image(center_xy, image)`

![](https://651142499-files.gitbook.io/~/files/v0/b/gitbook-legacy-files/o/assets%2F-MRAMSGwqRIdQ2ADsTkz%2F-MR_npajpEZf8wpIj8HL%2F-MRaGEPex2n6zJasiFXn%2Fimage.png?alt=media\&token=4ad09f11-5064-4217-b1ea-0e630e426741)

| Property    | Default Value                      | Description                                                                                                           |
| ----------- | ---------------------------------- | --------------------------------------------------------------------------------------------------------------------- |
| `center_xy` | <p>REQUIRED</p><p>(No default)</p> | The center coordinate (x, y) of where to draw the image.                                                              |
| `image`     | <p>REQUIRED</p><p>(No default)</p> | <p>The image file to draw.</p><p>Use the <code>open\_image()</code> function to create the required image object.</p> |
| `visible`   | True                               | <p>True = Image can be seen.</p><p>False = Image cannot be seen.</p>                                                  |

Example:

```python
pic = easy_draw.open_image("super_cool_image.png")

img = easy_draw.Image(
    center_xy = (300,300),
    image = pic
)
```

Images can rotate, just like every other Easy Draw object:

```python
img.rotate(45)
```
