It looks like you want your reaction diffusion to react stronger / faster / more often in different parts.
Here is a simple example without a mask. If the column is on the far left, it is almost never updated. If the column is on the far right, it is almost always updated. Columns in the middle have a 50% chance of updating.
void update() {
for (int i = 1; i < width-1; i++) {
if (random(width)<i) {
for (int j = 1; j < height-1; j ++) {
Here is a simple diffusion of your base image (no mask) with variable updating of the columns in update(), as above:
You could do this per-pixel based on a mask, of course – given the brightness() of a mask pixel, have it more or less likely that the pixel will update – or have some pixels update 0, 1, 2, 3 times. Do it in update(), though – not in draw().
void update() {
for (int i = 1; i < width-1; i++) {
if (random(100)<i) { //Column i
for (int j = 1; j < height-1; j ++) { // column j
I’m trying to change a bit the value in order to control the rectangle : on the left I’m trying to don’t have the reaction diffusion at all but only to see the black original rectangles, the reaction diffusion it only starts from the middle to the right part, is it right how I’m changing the value here ?
Do you think It works even If I have an oblique line instead of having columns? I’m studying the link that you sent me where It explains the rectangles, probably it works in the same way but at the moment I’m focusing in the columns,