allColors.frink

Download or view allColors.frink in plain text format


/** program to make an image with each pixel in a different color.  Now what?
*/


stepsize = 4

range = new range[0, 255, stepsize]

colors = new array
multifor color = [range, range, range]
{
   colors.push[color]
}

colors.shuffle[]

side = ceil[sqrt[length[colors]]]
img = new image[side, side]

idx = 0
for [r,g,b] = colors
{
   img.setPixelInt[idx div side, idx mod side, r,g,b]
   idx = idx + 1
}

img.show[]
img.write["allColors.png"]

//img2 = img.gaussianBlur[3]
//img2.show[]



Download or view allColors.frink in plain text format


This is a program written in the programming language Frink.
For more information, view the Frink Documentation or see More Sample Frink Programs.

Alan Eliasen was born 20293 days, 4 hours, 44 minutes ago.