Thumbnail.

Meta

Description

Algorithm to convert any Image to allRGB by smapling randomly:

  1. sort an array of all 16777216 image positions (x,y) randomely
  2. loop the positions array and for each position:
  3. read the pixel color at the position as a reference
  4. sample N random colors from the available colors list
  5. for each sample calculate the hypotenuse from the reference color Math.hypot(R - r, G - g, B - b).
  6. find the nearst color, use it for that position in the output image
  7. update the list of avalible colors (for practicality in chunks)

Author

alzayani
7 entries

Stats

Date
Colors16,777,216
Pixels16,777,216
Dimensions4,096 × 4,096
Bytes55,013,354