Skip to main content

Inkplate 6COLOR – Draw Image from Web

Example showing how to connect to WiFi and render an image fetched from URL using drawImage.

ℹ️
Supported image formats: JPG, BMP, and PNG.
⚠️
JPG files without progressive encoding are supported.
ℹ️
If you experience issues displaying an image, try re-saving it with an image editing program. The issue is usually related to the image format.

Drawing an Image

Example image to show on inkplate
Example image
# Include needed libraries
import network
import time
from inkplate6COLOR import Inkplate

# WiFi credentials (replace with your own)
SSID = "YOUR_SSID_HERE"
PASSWORD = "YOUR_PASSWORD_HERE"

inkplate = Inkplate()

inkplate.begin()

# Connect to WiFi (connection process explained on previous page)
if not do_connect():
raise SystemExit("WiFi connection failed")

# Example usage:
inkplate.drawImage(
"https://i.imgur.com/nSExTGr.jpeg", # URL to image
0, 0, # X, Y position
invert=False, # Do not invert colors
dither=True, # Enable dithering
kernel_type=Inkplate.KERNEL_FLOYD_STEINBERG # Dithering algorithm
)

# Show the image from the internal buffer
inkplate.display()
Expected output on Inkplate display
Example image displayed on Inkplate with Dithering enabled
Expected output on Inkplate display
Example image displayed on Inkplate without Dithering

inkplate.drawImage()

This function draws an image from the specified char path (either web URL or local file path)

Returns value: None

Function parameters:

TypeNameDescription
stringpathPath and filename of the image. Can be a URL (for web images) or a file path (on the microSD card).
intx0X-coordinate of the image's upper-left corner in the framebuffer.
inty0Y-coordinate of the image's upper-left corner in the framebuffer.
boolinvertIf true, inverts colors.
boolditherDithering mode: 0 (disabled), 1 (enabled).
intkernel_typeSpecifies dithering algorithm to use.
ℹ️

Available options for dithering algorithm:

AlgorithmValue
Inkplate.KERNEL_FLOYD_STEINBERG0
Inkplate.KERNEL_JJN1
Inkplate.KERNEL_STUCKI2
Inkplate.KERNEL_BURKES 3

Performance Notes

  • JPG: ~3 seconds (or ~14s with dithering)
  • PNG: ~9 seconds (or ~19s with dithering)
  • BMP: ~20 seconds (or ~40s with dithering)
  • Maximum image file size: ~800kB