Image

Use an image as a Widget.

wimg = Image(source='mylogo.png')

Asynchronous loading

If you want to load your image in an asynchronous way, you may use the AsyncImage class. You can use it for loading external images on the web.

image = AsyncImage(source='http://mywebsite.com/logo.png')

Alignement

By default, the image is centered and fitted inside the widget bounding box. If you don’t want that, we suggest you to inherit from Image, and create your own style.

For example, if you want your image to take the same size of your widget, you can do

class FullImage(Image):
    pass

And in your kivy language file, you can do

<FullImage>:
    canvas:
        Color:
            rgb: (1, 1, 1)
        Rectangle:
            texture: self.texture
            size: self.size
            pos: self.pos
class kivy.uix.image.Image(**kwargs)

Bases: kivy.uix.widget.Widget

Image class, see module documentation for more information.

image_ratio

Ratio of the image (width / float(height)

image_ratio is a AliasProperty, and is read-only.

norm_image_size

Normalized image size withing the widget box.

This size will be always fitted to the widget size, and preserve the image ratio.

norm_image_size is a AliasProperty, and is read-only.

source

Filename / source of your image.

source a StringProperty, default to None.

texture

Texture object of the image.

Depending of the texture creation, the value will be a Texture or TextureRegion object.

texture is a ObjectProperty, default to None.

texture_size

Texture size of the image.

Warning

The texture size is set after the texture property. So if you listen on the change to texture, the property texture_size will be not yet updated. Use self.texture.size instead.

class kivy.uix.image.AsyncImage(**kwargs)

Bases: kivy.uix.image.Image

Asynchronous Image class, see module documentation for more information.