Skip to content

Image Element

Display remote images (PNG, JPG, animated GIF) on your UI.

lua
ui:element({
    id = "logo", type = "image",
    rect = { unit = "px", x = 10, y = 10, w = 200, h = 120 },
    props = { url = "https://example.com/image.png" },
})
  • Each client downloads the image independently — the URL flows through the standard UI sync pipeline
  • Animated GIFs play back frame-by-frame with correct timing, transparency, and looping
  • Images are cached in a per-client LRU cache (default 64 entries)
  • Transparency is fully supported (PNG alpha, GIF transparency)
PropDescription
urlHTTP/HTTPS URL to a PNG, JPG, or GIF image

Server Config

SettingDefaultDescription
AllowRemoteImagestrueGate whether image elements are processed
MaxImageDimension1024Max width/height in pixels
ImageCacheSize64LRU cache max entries

⚠️ This documentation was AI-generated and may contain inaccuracies. Please submit pull requests with corrections as needed.