2 ms·
According to the user on that site "alzayani": sort an array of all 16777216 image positions (x,y) randomly loop the positions array and for each position: r
by haneefmubarak 3y ago
According to the user on that site "alzayani":
sort an array of all 16777216 image positions (x,y) randomly
loop the positions array and for each position:
read the pixel color at the position as a reference
sample N random colors from the available colors list
for each sample calculate the hypotenuse from the reference color Math.hypot(R - r, G - g, B - b).
find the nearst color, use it for that position in the output image
update the list of avalible colors (for practicality in chunks)