# OpenSimplexNoise is a bit too slow

**URL:** <https://discourse.processing.org/t/opensimplexnoise-is-a-bit-too-slow/10160>\
**Category:** Coding Questions\
**Created:** [April 10, 2019, 9:22am UTC](https://discourse.processing.org/t/opensimplexnoise-is-a-bit-too-slow/10160 "2019-04-10T09:22:58Z")\
**Posts on this page:** 1\
**Showing post:** 2

<div class="post-metadata">

**Author:** ![kll](https://yyz2.discourse-cdn.com/flex036/user_avatar/discourse.processing.org/kll/32/964_2.png) [@kll](https://discourse.processing.org/u/kll)\
**Post date:** [April 10, 2019, 9:55am UTC](https://discourse.processing.org/t/opensimplexnoise-is-a-bit-too-slow/10160/2 "2019-04-10T09:55:13Z")

</div>

besides the load / update Pixels code i show you  
[Weird behaviour with loadPixels() and updatePixels()](https://discourse.processing.org/t/weird-behaviour-with-loadpixels-and-updatepixels/7741/2) already  
also you could just reduce the amount of calculations…

like ( untested )

```auto
  for(int x = 0; x < width; x++) {
    float xdef = x / definition;
    for(int y = 0; y < height; y++) {
      float ydef = y / definition;   
      float r = map((float) noise.eval(xdef, ydef, z[0]), -1, 1, 0, 255);
      float g = map((float) noise.eval(xdef, ydef, z[1]), -1, 1, 0, 255);
      float b = map((float) noise.eval(xdef, ydef, z[2]), -1, 1, 0, 255);
     
      //set(x,y,color(r,g,b));
      changePixelColor(x, y, r, g, b,d)
    }
}

```

and replace the map ?

```auto
float r = ( (float)noise.eval(xdef, ydef, z[0]) + 1.0 )*127;

```

and setting a

```auto
colorMode(RGB, 2.0);
//...
float r = (float)noise.eval(xdef, ydef, z[0]) + 1.0 ;

```

might also work;

---

_[View the full topic](https://discourse.processing.org/t/opensimplexnoise-is-a-bit-too-slow/10160)._
