We are about to switch to a new forum software. Until then we have removed the registration on this forum.
What is the use of format in createImage? I would expect that creating a image with ALPHA would be faster then ARGB but it makes no difference.
void setup() {
for (int j = 0; j < 10; j++) {
int start = millis();
for (int i = 0; i < 1000; i++) {
PImage img = createImage(1000, 1000, ALPHA);
}
int t = millis()-start;
println(t);
}
for (int j = 0; j < 10; j++) {
int start = millis();
for (int i = 0; i < 1000; i++) {
PImage img = createImage(1000, 1000, ARGB);
}
int t = millis()-start;
println(t);
}
}
Also i can draw colors in a ALPHA one:
PImage a;
void setup() {
a = createImage(1000, 1000, ALPHA);
for(int i = 0; i < a.pixels.length; i++) {
a.pixels[i] = (int) random(MAX_INT);
}
}
void draw() {
background(0);
image(a, 0, 0);
}
Does someone know what it's for?
Answers
I see differences in the treatment of blur(), and get() only returns a grayscale value. Apparently, it is also here to support a TGA format.
And I think it is also used for VLW fonts.
Ok thanks. Nothing to worry about really :)