# Can someone explain noise() aka perlinNoise() function?

**URL:** <https://discourse.processing.org/t/can-someone-explain-noise-aka-perlinnoise-function/26627>\
**Category:** Beginners\
**Created:** [December 30, 2020, 11:09pm UTC](https://discourse.processing.org/t/can-someone-explain-noise-aka-perlinnoise-function/26627 "2020-12-30T23:09:57Z")\
**Posts on this page:** 1\
**Showing post:** 5

<div class="post-metadata">

**Author:** ![micycle](https://yyz2.discourse-cdn.com/flex036/user_avatar/discourse.processing.org/micycle/32/201_2.png) [@micycle](https://discourse.processing.org/u/micycle)\
**Post date:** [December 30, 2020, 11:35pm UTC](https://discourse.processing.org/t/can-someone-explain-noise-aka-perlinnoise-function/26627/5 "2020-12-30T23:35:35Z")

</div>

> [@CodeMasterX](#):
>
> ```auto
> How do I use noise()?
> 
> ```

You’re using the function correctly but at the “wrong scale”.

Scale down the noise inputs (so that the noise difference between successive pixels is lesser; i.e. the frequency is reduced) and you’ll get a more expected result:

```auto
final float scale = 0.01;

void draw() {
  for(int i = 0; i < width; i++) {
    for(int j = 0; j < height; j++) {
      stroke(noise(i*scale,j*scale)*255);
      point(i,j);
    }
  }
  noLoop();
}

```

Note that `noiseDetail()` doesn’t affect the “zoom” or the pattern at a coarse level, but affects the finer detail of the noise pattern – higher values for noiseDetail are more important the more “zoomed in” the noise is.

scaled inputs, with noiseDetail = 4 (default):

 ![image](https://canada1.discourse-cdn.com/flex036/uploads/processingfoundation1/original/2X/2/25bde274078e0ffbe087f2fa371c7a23d4174c36.jpeg)

scaled inputs, with noiseDetail = 8:

 ![image](https://canada1.discourse-cdn.com/flex036/uploads/processingfoundation1/original/2X/7/7b0da9550997988566312f98498255d9c14cfc45.jpeg)

However, back to your original image, the zoomed out view shows us that Processing’s noise function is terrible at large scales – we can clearly see it’s not randomly noisy (in the manner we would like) at all! ([Why is perlin noise looping? - #4 by jeremydouglass](https://discourse.processing.org/t/why-is-perlin-noise-looping/10155/4))

---

_[View the full topic](https://discourse.processing.org/t/can-someone-explain-noise-aka-perlinnoise-function/26627)._
