Skip to content

Instantly share code, notes, and snippets.

@Gargaj
Last active August 29, 2015 14:06
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save Gargaj/da529d2edb365c940f49 to your computer and use it in GitHub Desktop.
Save Gargaj/da529d2edb365c940f49 to your computer and use it in GitHub Desktop.
Color grading LUT generator
int block = 32;
void setup() {
size( block * block, block );
}
void draw() {
loadPixels();
int scale = 256 / block;
for (int r=0; r<block; r++)
for (int g=0; g<block; g++)
for (int b=0; b<block; b++)
{
pixels[ g * width + r + b * block ] = color( r * scale, g * scale, b * scale );
}
updatePixels();
}
void keyPressed()
{
String fn = "LUT" + block + ".png";
print("saved " + fn);
save(fn);
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment