# Pixel Sorting Algorithms

A visualization of a number of common sorting algorithms such as insertion, merge, and quick sort using images as the base.

# Original

# Sorted

Algorithm:

Notes:

- The speed isn't necessarily true to the actual algorithm speed since some had to be modified a bit to run in a loop with updates in between.
- Merge sort might hang the browser for a bit when first ran since it has to create a stack to be used later on.
- For interesting visual effects, change the 'pixelDistance' variable in the JavaScript panel. This variable is used to set the distance between each pixel value in the image data array. The correct value is 4 since there are 4 pixels, RGBA.
- For faster runtimes, make the 'imageSize' variable smaller