Products
Features
YouTube Video Summarizer
Summarize YouTube videos
Web & PDF Highlighter
Highlight web pages & PDFs
Chat with PDF
Ask any PDF questions with AI
Ask AI Clone
Chat with your highlights & memories
Audio Transcriber
Transcribe audio files to text
Glasp Reader
Read and highlight articles
Kindle Highlight Export
Export your Kindle highlights
Idea Hatch
Hatch ideas from your highlights
Integrations
Obsidian Plugin
Notion Integration
Pocket Integration
Instapaper Integration
Medium Integration
Readwise Integration
Snipd Integration
Hypothesis Integration
Apps & Extensions
Chrome Extension
Safari Extension
Edge Add-ons
Firefox Add-ons
iOS App
Android App
Discover
Discover
Ideas
Discover new ideas and insights
Articles
Curated articles and insights
Books
Book recommendations by great minds
Posts
Essays and notes from readers
Quotes
Inspiring quotes collection
Videos
Curated videos and summaries
Explore Glasp
Glasp Newsletter
Weekly insights and updates
Glasp Talk
Interview series with great minds
Glasp Blog
Latest news and articles
Glasp Use Cases
Learn how others use Glasp
Build & Support
Glasp API
Access Glasp's API for developers
MCP Connector
Connect Glasp to Claude & ChatGPT
Community
Glasp Reddit Community
Students
Student discount and benefits
FAQs
Frequently Asked Questions
AboutPricing
DashboardLog inSign up

Coding Challenge 181: Weighted Voronoi Stippling

145.8K views
•
February 22, 2024
by
The Coding Train
YouTube video player
Coding Challenge 181: Weighted Voronoi Stippling

TL;DR

Learn how to use the concept of Voronoi diagrams and Lloyd's relaxation algorithm to create stunning stippled images.

Transcript

This is actually a true story. I slept with this paper-- Weighted Voronoi Stippling under my pillow with the hope that it would absorb into my mind somehow. [MUSIC PLAYING] It's time for another coding challenge. I am very excited about this one. It is a high degree of difficulty, but if I've made it succeed, you know already. I don't know, but you... Read More

Key Insights

  • 🔺 Voronoi diagrams divide a plane into regions based on proximity to seed points, while Delaunay triangulation constructs triangles with circumcircles related to the Voronoi diagram.
  • 😥 Lloyd's relaxation algorithm optimizes the distribution of points in a Voronoi diagram by moving them towards the centroids of the polygons, resulting in evenly spaced points.
  • 😥 Weighted Voronoi stippling involves assigning weights to seed points based on pixel intensities in an image, allowing for the creation of stippled images that reflect the underlying patterns.
  • 📚 Libraries like d3.js and p5.js can be used together to implement these algorithms and create beautiful stippled images.
  • 🫥 Experimentation with factors such as dot size, colors, and applying the technique to videos can lead to further creative possibilities.
  • 👨‍💻 Cleaning up and optimizing the code is recommended for better performance and understanding.

Install to Summarize YouTube Videos and Get Transcripts

Explore YouTube Video Summarizer or Get YouTube Transcript Extractor

Questions & Answers

Q: What is a Voronoi diagram and how is it related to Delaunay triangulation?

A Voronoi diagram is a tessellation that divides a plane into regions based on proximity to a set of seed points. Delaunay triangulation uses the same set of seed points to build a mesh of triangles, where each triangle has a circumcircle associated with it.

Q: How is the Delaunay triangulation calculated in the video?

The video demonstrates the use of a package inside the d3.js library to compute the Delaunay triangulation, specifically using the d3-delaunay triangulation package. The code showcases how to convert p5.js vectors into a format compatible with d3.js to compute the triangles.

Q: What is Lloyd's relaxation algorithm and how does it improve Voronoi stippling?

Lloyd's relaxation algorithm, also known as a relaxation algorithm, aims to optimize the distribution of points in a Voronoi diagram. By finding the centroids of each polygon and moving the seed points towards these centroids, the algorithm gradually spreads out the dots in a way that is visually pleasing.

Q: How is weighted Voronoi stippling achieved?

Weighted Voronoi stippling involves assigning weights to the seed points based on the brightness of the corresponding pixels in an image. The Lloyd's relaxation algorithm is then used to distribute the dots in a manner that reflects the image's underlying pattern, resulting in a stippled image with varying dot densities.

Summary & Key Takeaways

  • The video explores the concepts of Voronoi diagrams and Delaunay triangulation to create a base for weighted Voronoi stippling.

  • Lloyd's relaxation algorithm is then introduced to optimize the distribution of dots in the stippling, creating a more even and visually appealing result.

  • The video demonstrates how to implement these concepts using the d3.js library in combination with p5.js.


Read in Other Languages (beta)

English

Share This Summary 📚

Summarize YouTube Videos and Get Video Transcripts with 1-Click

Download browser extensions on:

Try YouTube Summary with ChatGPT & Claude or YouTube Transcript Generator

Explore More Summaries from The Coding Train 📚

9.4: Genetic Algorithm: Looking at Code - The Nature of Code thumbnail
9.4: Genetic Algorithm: Looking at Code - The Nature of Code
The Coding Train
8.1: Fractals - The Nature of Code thumbnail
8.1: Fractals - The Nature of Code
The Coding Train
Text Generation using Spell with Nabil Hassein thumbnail
Text Generation using Spell with Nabil Hassein
The Coding Train
Classifying Poses with ml5.js Part 2 thumbnail
Classifying Poses with ml5.js Part 2
The Coding Train
Coding Challenge #126: Toothpicks thumbnail
Coding Challenge #126: Toothpicks
The Coding Train
ITP/IMA Winter Show 2019 thumbnail
ITP/IMA Winter Show 2019
The Coding Train

Summarize YouTube Videos and Get Video Transcripts with 1-Click

Download browser extensions on:

Try YouTube Summary with ChatGPT & Claude or YouTube Transcript Generator

Apps & Extensions

  • Chrome Extension
  • Safari Extension
  • Edge Add-ons
  • Firefox Add-ons
  • iOS App
  • Android App

Key Features

  • YouTube Video Summarizer
  • Web & PDF Summarizer
  • Web & PDF Highlighter
  • Chat with PDF
  • Ask AI Clone
  • Audio Transcriber
  • Glasp Reader
  • Kindle Highlight Export
  • Idea Hatch

Integrations

  • Obsidian Plugin
  • Notion Integration
  • Pocket Integration
  • Instapaper Integration
  • Medium Integration
  • Readwise Integration
  • Snipd Integration
  • Hypothesis Integration

More Features

  • APIs
  • MCP Connector
  • Blog & Post
  • Embed Links
  • Image Highlight
  • Personality Test
  • Quote Shots

Company

  • About us
  • Blog
  • Community
  • FAQs
  • Job Board
  • Newsletter
  • Pricing
Terms

•

Privacy

•

Guidelines

© 2026 Glasp Inc. All rights reserved.