APIImagesOverview

Images

Image helpers load PNG, JPG, and SVG assets and draw them at native size, transformed, or from a source rectangle.

API

  • load_image(filename: str) -> Image
  • unload_image(image: Image) -> None
  • draw_image(image: Image, x: int, y: int) -> None
  • draw_image_ex(image: Image, x: int, y: int, rotation: float = 0, scale: float = 1.0, tint: Color = WHITE) -> None
  • draw_image_rec(image: Image, source_rect: tuple[int, int, int, int], x: int, y: int, tint: Color = WHITE) -> None
  • get_image_width(image: Image) -> int
  • get_image_height(image: Image) -> int
  • get_image_size(image: Image) -> tuple[int, int]
from conjure import *
 
init_window(360, 640, "Images")
player = load_image("player.png")
 
while not window_should_close():
    begin_drawing()
    clear_background(WHITE)
    draw_image_ex(player, 140, 260, 0, 2.0, WHITE)
    end_drawing()

Read using assets for a practical upload workflow.