Chalk · by Hoverfly

Draw it.
Chalk knows what it is.

Read the pen strokes of a doodle and guess what it is, out of 345 everyday things, even before the drawing is finished. On the device itself: Android, iOS, desktop and the web, from one Kotlin Multiplatform library.

Get started View source

Free up to 10k monthly active devices · No API key · On Maven Central · Android, iOS, desktop, web

Chalk thinks it's
…
chalk.guess(strokes) · after every stroke
Live demo

Draw something, it guesses live

This is the actual Chalk library, compiled to WebAssembly and running in your browser. Doodle any of 345 everyday things with your mouse or finger. It guesses while you draw. Your drawing never leaves this page.

Loading the model (~2 MB)…
Draw here: a cat, a house, a bicycle…

Chalk guesses

Guesses update as you draw
Why Chalk

A sketch recogniser that fits anywhere

No server, no API key, no per-request bill. A small Kotlin library that you can read, test and ship.

Reads strokes

Pass the points the finger drew, straight from your canvas. Size and position on screen don't matter; the drawing is simplified on the device the same way the training data was.

Guesses while you draw

Trained on half-finished drawings too, so it can guess after the first strokes, like the Quick, Draw! game. It beats a 200× larger model there.

No dependencies

Pure Kotlin inference. There is no ONNX Runtime, TFLite, ML Kit or native code, and it runs on Android (minSdk 21), iOS, macOS, JVM desktop, JavaScript and WebAssembly, from Kotlin or Java.

Private & offline

The model ships inside the library on every platform. It makes no network calls, needs no permissions and sends no telemetry.

81%
First guess right
94% in the top 3
1.7MB
On-device
int8 weights
345
Things
animals, food, objects, places
0
Dependencies
no native code
On device

Draw with a finger, see the guess

Real output from the sample app on an Android emulator, drawn with touch events. These are not mockups.

Chalk recognises a house

House

house 89% · barn 6%

Chalk recognises a sun

Sun

sun 93%

Chalk recognises a fish

Fish

fish 97%

Chalk recognises a half-drawn house

Half-drawn

walls and roof only: house 86%

Same library on every platform

The Kotlin Multiplatform sample app, built from the published artifacts, gives the same result on Android, iOS, desktop and the web.

Chalk sample on Android

Android

house 72% · barn 19%

Chalk sample on iOS

iOS

house 72% · barn 19%

Chalk sample on Desktop (JVM)

Desktop (JVM)

house 72% · barn 19%

Chalk sample on Web (Wasm)

Web (Wasm)

house 72% · barn 19%

Install

Add it to your build

One line in your Gradle file, from Maven Central. Works in commonMain for Android, iOS, macOS, JVM desktop, JavaScript and WebAssembly. No API key, no account.

Maven Central live
// build.gradle.kts: commonMain, or any platform source set
dependencies {
    implementation("io.github.rajumark:chalk:2.0.0")
}

// Gradle picks the right artifact per platform:
// chalk-android · chalk-jvm · chalk-iosarm64 · chalk-iossimulatorarm64
// chalk-macosarm64 · chalk-js · chalk-wasm-js
Build with a prompt
Add Chalk from rajumark to this Kotlin Multiplatform or Android project.

What it does: on-device doodle recognition. Given the pen strokes of a drawing (screen pixels), it returns the most likely of 345 everyday things (the Quick, Draw! categories), even for half-finished drawings. 1.7 MB, no dependencies, no network.

Install (Maven Central, no extra repository):
  build.gradle.kts (commonMain or any source set): implementation("io.github.rajumark:chalk:2.0.0")
  Platforms: Android, iOS, macOS, JVM desktop, JavaScript, WebAssembly

Usage:
  val chalk = Chalk()                         // off the main thread, keep one instance
  val strokes = listOf(Stroke(xs, ys), ...)          // one Stroke per finger-down ... finger-up
  val guesses = chalk.guess(strokes)                 // [Guess(label=house, score=0.89), ...]

Repo: https://github.com/rajumark/chalk#readme
Add the dependency, then follow the README for the exact API and current version.
Usage

One call per stroke

Load once and reuse the instance. guess() is thread-safe; call it after every stroke to guess live.

Kotlin
val chalk = Chalk()

val strokes = mutableListOf<Stroke>()
// on every finger-up:
strokes += Stroke(xs.toFloatArray(), ys.toFloatArray())
chalk.guess(strokes)
// [Guess(label=house, score=0.89), Guess(label=barn, score=0.06), ...]

chalk.guess(strokes, count = 5)
chalk.close()
Java
try (Chalk chalk = new Chalk()) {
    List<Guess> guesses = chalk.guess(strokes);
    String best = guesses.get(0).getLabel();
}
Use cases

Where Chalk fits

Anywhere people draw with a finger or a stylus.

Drawing games

Pictionary-style party games and "draw this in 20 seconds" challenges, fully offline.

guess after every stroke → "Is it a house?"

Kids' learning apps

"Draw a fish": check the drawing on the device, with no child's data leaving the phone.

fish 97%

Sketch search

Draw an icon to find an emoji, a sticker, an app or a product category.

draw a sun → ☀️

Notes & whiteboards

Tag doodles in handwritten notes so they are searchable, or turn a rough sketch into a clean clip-art icon.

doodle → tag "bicycle"
App ideas

20 apps you could build with Chalk

Real problems Chalk solves today. Pick one and ship it.

Offline Pictionary · A party game where the phone guesses your drawing live, no internet needed.

Kids drawing buddy · Cheer "That's a cat!" while a child draws, and suggest what to draw next.

Sketch search · Draw a shoe or a chair to search a shop catalogue instead of typing.

Draw-to-emoji · Sketch a heart, sun or pizza in chat and insert the matching emoji or sticker.

Vocabulary flashcards · Show "manzana" and ask the learner to draw it to prove they know the word.

Toddler first words · A toddler draws a dog, the app says "dog" out loud and shows a picture.

Classroom quiz · The teacher says "draw a triangle" and every tablet checks the answer offline.

Speed drawing challenge · "Draw 5 things in 60 seconds" daily streak game with an on-device judge.

Interactive storybook · The child draws a dragon, and the story continues with that dragon in it.

Doodle cleanup · Swap rough whiteboard doodles for clean icons in a notes or slides app.

Sketchbook search · Auto-tag old doodles so users can search their notebook for "bicycle".

Gesture shortcuts · Draw an envelope to open mail or a camera to open the camera.

Smartwatch doodle input · Draw a tiny heart or coffee cup on a watch to send it as a reply.

Picture talk (AAC) · People who can't speak or type draw what they need, like water or a bed.

Drawing lessons · Check each practice sketch and show when it becomes recognisable.

Greeting card maker · Sketch rough shapes and get matching clip-art placed on the card.

Brain-training game · Timed recall rounds: "draw the 3 objects you just saw".

Doodle shopping list · Draw a banana and a carrot; get a readable list for kids or low-literacy users.

Human check · Ask users to draw a simple object as a friendlier offline alternative to text CAPTCHAs.

Multiplayer guessing · Pass-the-phone game where players race the AI to guess each drawing.

Quality

Honest numbers

Quick, Draw! drawings never used for training (50 per category, 17,250 in total), through the same touch-input pipeline the library uses. Top-1 = the first guess is right; top-3 = the answer is among the first three.

ChalkBEiT-base sketch classifierMobileViT-small (QuickDraw)
Finished drawings: top-1 / top-381.5% / 94.3%83.3% / 95.6%70.6% / 87.9%
Half-drawn: top-1 / top-353.3% / 73.9%50.1% / 69.7%40.4% / 59.7%
Size1.8 MB348 MB21 MB
Latency, one drawing, 1 CPU thread (laptop)~1 ms~69 ms~2.5 ms

A 200× larger image model is 1.8 points more accurate on finished drawings; Chalk is better at guessing while the user is still drawing, and about the same for drawings from every country (India 80.4%, US 81.1%, UK 80.3%). Hardest categories: marker, bear, garden hose, aircraft carrier (34–40%); easiest: helicopter, angel, star, ladder, The Mona Lisa (97–98%).

Reference

API at a glance

MemberDescription
Chalk()Loads the bundled model. Implements AutoCloseable.
guess(strokes, count = 3)The count most likely labels, best first, as Guess(label, score). Empty for no points.
probabilities(strokes)A probability for every label, in the order of labels; null for no points.
labelsThe 345 labels, as Quick, Draw! names them.
Stroke(x, y) · Stroke.of(x0, y0, …)One stroke: the points from finger-down to finger-up, in any coordinates.
Pricing & license

Free until you're big.

No API key, no sign-up, no license file. Add Chalk to your project and ship. It stays free until your product passes 10,000 monthly active devices, and there's never a limit on how often each device runs it.

Commercial
Let's talk

For products above 10,000 monthly active devices on any platform.

  • One license per product, per model
  • Pricing that fits your scale
  • Direct support from the people who built it
  • Early access to model updates
Custom models
Built for you

A small, fast on-device model trained for your language, domain or task.

  • Sketch and handwriting recognition, moderation, classification and more
  • Tuned on your use case and your users' languages
  • Shipped as a plain Kotlin library, like Chalk
  • Private: your model runs on your users' devices

How devices are counted

A monthly active device is a phone, tablet or other device that runs Chalk at least once in a calendar month.

The 10,000 limit applies separately to each product, each platform (Android, iOS, web…) and each Hoverfly model. Crossed it? You have 30 days to get a commercial license.

What the license does not allow

  • Selling or redistributing Chalk or its model on its own, or inside another SDK
  • Extracting, modifying or fine-tuning the model weights
  • Using the model or its outputs to train or distill another model
  • Reverse engineering the model or its file format
  • Offering it as a hosted API for others

Questions about licensing? Email raju348636@gmail.com or call / WhatsApp +91 63533 21951. Full terms: Hoverfly Community License.

FAQ

Questions

What is Chalk?

A Kotlin Multiplatform library (Android, iOS, macOS, JVM desktop, JavaScript, WebAssembly) that recognises doodles: give it the strokes of a drawing and it guesses which of 345 everyday things it shows.

Which things does it know?

The 345 categories of Google's Quick, Draw!: animals (cat, dog, lion, fish …), food (pizza, banana, cake …), vehicles, household objects, shapes, body parts and landmarks like The Eiffel Tower. chalk.labels lists them all. Anything else gets the nearest of these.

Do I need to send an image?

No. Chalk reads strokes, the points a finger or stylus draws. It is much smaller and faster than an image model, and it knows the order the lines were drawn in, which is what lets it guess early.

Can it guess before the drawing is finished?

Yes. It was trained on half-finished drawings too. Call guess() after every stroke, or every few points while the finger moves.

How fast is it on a phone?

A few milliseconds on a laptop JVM, and in the same speed class as Hoverfly's other libraries on an Android emulator. Load it once, off the main thread, and call it from a background thread.

Is the Kotlin port exact?

From screen-like float coordinates, the simplified points, the top-3 guesses and the probabilities (within 0.000002) match the reference implementation on all 150 test drawings, on the JVM and on an Android device.

How much does Chalk cost?

Nothing for products with up to 10,000 monthly active devices per platform, including commercial apps. There is no API key or account, and no limit on how often it runs. Above that, a commercial license is needed; see Pricing.

Can you build a model for my app?

Yes. Hoverfly trains custom on-device models for your task and ships them as a small library like this one. Email raju348636@gmail.com or call / WhatsApp +91 63533 21951.

A note from the creator

Built by a developer, for developers.

Every model here started as a problem I hit in my own apps. I made them small, private and free to start, so you can spend your time on the part your users will love.

Raju ShingadiyaAndroid developer · creator of Hoverfly
Meet the maker
The Hoverfly family

Chalk is one of eight.

Eight small on-device models, one job each. Same install, same free tier, and the same promise: nothing leaves the device.

MojiEmoji suggestionsThe right emoji for any message, in 22 languages. BeaconLanguage detectionLanguage and script of any text, Hinglish included. CommaPunctuationTurns voice-typed text into readable sentences. ComebackSmart repliesThree tap-to-send replies for every message. EmotionEmotion detection28 emotions and an overall mood, per message. GatekeeperToxicity detectionCatches abuse and threats in Indian chat. HideoutPersonal info hidingHides phones, UPI, Aadhaar and more.
ChalkDoodle recognitionGuesses 345 things from pen strokes, live.You're here
View all models Hoverfly home