🔍
Read an Image
img.inspectThe DarkroomImagesLooks at an image and tells your flow about it: width, height, format, whether it's animated, its dominant colour, a 5-colour palette and how bright it is. Branches on whether it's an image at all — perfect for validating uploads.
When to use this
- →{{info.isDark}} tells you whether white or black text reads better on top
On the canvas
This is what Read an Image looks like when you place it on your flow. Each field below is something you configure in the inspector panel.
🔍Images
Read an Image
img.inspectimagerequired
image…
as
info
image
not_image
Config fields
| Field | Type | Req | What it does |
|---|---|---|---|
image | image | yes | Image 🖼️ |
asinfo | text | — | Save it as ✨ |
Output ports
imageRead it — details are in your spark
not_imageEmpty, unreadable, or not a picture
📐
In TypeScript, this would be…
Not something you need to write — just a look at what Kitcord does for you.
TypeScript
const { width, height } = image;
// Dominant colour: sample a small copy and count colour buckets
const tiny = createCanvas(64, 64);
tiny.getContext("2d").drawImage(image, 0, 0, 64, 64);
const pixels = tiny.getContext("2d").getImageData(0, 0, 64, 64).data;
// …bucket, sort, take the biggest → "#e11d48"Related pieces
More Images pieces