: A 2d image of all possible rgb colors I've been searching for an image that contains all possible rbg colors, but I simply cannot find one. I'm starting to think that's it's impossible, since
I've been searching for an image that contains all possible rbg colors, but I simply cannot find one. I'm starting to think that's it's impossible, since what I'm looking requires 3 dimensions.
I tried looking for things like "color wheel" or "hsv color" but I have been unable to find exactly what I'm looking for.
Is it even feasible to try to find a 2d image to represent a full rgb color scheme? And if yes, where can I find one?
To be explicit, I want a 2d image containing all (rgb) values (0-255, 0-255, 0-255)
More posts by @Cofer715
1 Comments
Sorted by latest first Latest Oldest Best
There are 16,777,216 (256^3) possible RGB color combinations, so a square image in which each color is assigned a single pixel would have dimensions of 4096 px by 4096 px.
The following Processing code will generate such an image:
int numLevels = 256; // Number of levels per color channel
int numChannels = 3;
int dim = (int)sqrt(pow(numLevels, numChannels));
int curX = 0, curY = 0;
color curColor;
void setup(){
size(dim, dim);
colorMode(RGB);
noLoop();
}
void draw(){
for (int rVal = 0; rVal < numLevels; rVal++){
for (int gVal = 0; gVal < numLevels; gVal++){
for (int bVal = 0; bVal < numLevels; bVal++){
curColor = color(rVal, gVal, bVal);
set(curX, curY, curColor);
curX++;
if (curX >= dim){
curX = 0;
curY++;
}
}
}
}
save("rgb_colors.tif");
}
Most operating systems won't allow Processing to create a window large enough to display the entire image, but the full-size image will be saved as rgb_colors.tif and placed in the same directory as the script.
Terms of Use Create Support ticket Your support tickets Stock Market News! © vmapp.org2024 All Rights reserved.