Turn a video into a line-art sketch by API with edgedetect
Sume's video filter allowlists edgedetect and negate. Edges come out as white wires on black; negating gives dark lines on white. Modes: wires, colormix, canny.

A pencil-sketch look can be had with two allowlisted filters in Video filter: edgedetect to draw edges and negate to flip them to dark lines on white. The default wires mode draws white or gray wires on black, which is why the negate helps. This is a stylised effect for B-roll or title backgrounds, not a way to get a clean vector outline.
Which edgedetect options shape the lines?
| Option | What it does |
|---|---|
mode | wires (default): white/gray wires on black. colormix: mixes colors. canny: detects edges on planes. |
low, high | Thresholds from 0 to 1, defaults about 0.078 and 0.196. A higher high keeps only strong edges. |
planes | Which planes to filter. Default is y, u, v, r, g and b. |
How do I get dark lines on white?
Chain negate after edgedetect. In a local ffmpeg 9.0.1 run on a test pattern, mode=canny:low=0.1:high=0.3 followed by negate came out predominantly light. Raise high if the frame is a mess of lines and lower it if the lines break up.
curl -X POST https://api.sume.com/v1/video-filter/check \
-H "Authorization: Bearer $SUME_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"video_url": "https://media.sume.com/artifacts/artf_demo/street.mp4",
"filtergraph": "edgedetect=mode=canny:low=0.1:high=0.3,negate"
}'Does this make a cartoon of my footage?
No. It outlines edges and discards color and shading, so the result reads as a line drawing. If you want a painted or illustrated restyle of a clip, that is a generative job, not a pixel filter. This one is deterministic: the same clip and settings give the same result.
Is there a way to keep some color under the lines?
colormix mode mixes colors into the output, and the allowlist also has blend, so a graph can split the clip, edge-detect one copy and blend it over the original. Try a simple split and blend graph on a short clip first; the check will tell you whether the filters are allowed before you pay for an encode.
What does a filter job cost and where are the limits?
The docs list $0.02 per encode job, with a source of at most 300 seconds, a filtergraph of at most 2048 characters and 32 named filters. The /v1/video-filter/check route runs the same allowlist and source checks for free and returns valid and next_action; a graph that passes can still fail on the worker (bad expression, memory, time), which comes back as a structured job error.
Sources
Related posts
More in Developers
- Veo 3.1 latency is 11 seconds to 6 minutes: set your poll to match
Google lists Veo 3.1 request latency from 11 seconds to 6 minutes at peak. Poll with a deadline over 6 minutes; Sume's video docs poll every 30 seconds.
- Veo 3.1 videos are stored 2 days: download them, and what Sume does
Google says Veo videos are stored for 2 days, and referencing one for extension resets the timer. Save the file early; Sume jobs return Sume-hosted artifacts.
- AI Gateway async video 413 at 300 KiB: hosted URLs on Sume
AI Gateway caps the persisted video start request at 300 KiB and answers inline base64 with 413. On Sume, send public HTTPS URLs; 413 is payload_too_large.
- Vercel AI Gateway poll intervalMs and timeoutMs vs Sume polling
AI Gateway's poll option sets intervalMs (5000) and timeoutMs (600000). Sume jobs return next_poll_after_seconds, and your client owns the deadline.
Written by Sume