Skip to content

andrewlidong/PixelPaint

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

3 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

PixelPaint

About

PixelPaint is a random sampling algorithm visualization tool. PixelPaint takes sampling algorithms and uses them over visualizations to create beautiful diagrams.

PixelPaint supports 4 sampling algorithms (Poisson, Mitchell's Best Candidate, Uniform Random and Uniform). Additionally, PixelPaint also offers 3 visualizers (Voronoi, Stippling, and Generation Maze). PixelPaint offers explanations of each algorithm and visualizer, a live animation over a set of 5 sample paintings and the opportunity for user input.

Access the live site here

Demo

PixelPaint-gif1

Functionality

  • Poisson Sampling
  • Mitchell's Best Candidate Sampling
  • Uniform Random Sampling
  • Uniform Sampling
  • Voronoi Visualization
  • Stippling Visualization
  • Generation Map Visualization
  • User Image Upload

Poisson Sampling

Bridson's algorithm for Poisson sampling chooses a sample from a completely random cluster and attempts to find a suitable candidate within its annulus. It delivers a tight, random cluster of samples by placing new samples distance 2r from the existing sample. Meanwwhile it also ensures that the sample isn't within distance (r) of any other. To reduce the search for potential conflicts, a reference grid is used to store all sample points. If a specific number of candidates have been drawn from the reference point without a valid one being found, the reference point is removed from the active samples list. The algorithm concludes once the active samples list is empty.

Mitchell's Best Candidate

Mitchell's best candidate draws a specified number of candidates at random and selects the one with the largest distance from the existing samples. It yields a more even distribution of samples than a uniform random distribution, but comes at the cost of having to check neighboring distances. Our implementation involves a quadtree for quicker nearest neighbor checks.

Uniform Random

Uniform random selects points at completely random X and Y axes until the sample size is reached. It is ineffective for sampling since it leads to clustering which in turn leads to undersampled spots. This can be seen by the over and undersampled points in the stippling and voronoi diagrams.

Uniform

Uniform grid takes points generated at set distance and angles from existing points. This can be ineffective in that strict patterns can lead to an aliasing effect.

Voronoi

A Voronoi Diagram takes a series of points and creates polygons mapped by the region closest to each sampling point. Each pixel within a particular polygon is closer to it's polygon's sample point than any other. The color of the sample point determines the color of the Voronoi polygon.

Stippling

Stippling is the creation of a pattern displaying varying degrees of shading with small dots. For each point generated by the sample, dots are placed on the canvas. The sizes of these dots are dependent on the point's grayscale value in the original image.

Generation Map

In a Generation Map, trees are built where each node's parent is the active point from which the concurrent branch is built. The result is a series of mazelike winding branches.

User Image Upload

Users can upload their own images which are supported by all the above random sampling visualizations.

About

PixelPaint is a random sampling algorithm visualization tool

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published