# Alternative Noise Implementations

**URL:** <https://discourse.processing.org/t/alternative-noise-implementations/28345>\
**Category:** Gallery\
**Created:** [March 8, 2021, 5:08pm UTC](https://discourse.processing.org/t/alternative-noise-implementations/28345 "2021-03-08T17:08:41Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![monkstone](https://yyz2.discourse-cdn.com/flex036/user_avatar/discourse.processing.org/monkstone/32/64_2.png) [@monkstone](https://discourse.processing.org/u/monkstone)\
**Post date:** [March 8, 2021, 5:08pm UTC](https://discourse.processing.org/t/alternative-noise-implementations/28345/1 "2021-03-08T17:08:41Z")

</div>

Recently I posted about selectable noise implementation in [ruby processing](https://discourse.processing.org/t/selectable-noise-implementation-in-ruby-processing/28288). Since then I’ve done a bit more research and came upon the this post about about [OpenSimplex in processing](https://necessarydisorder.wordpress.com/2017/11/15/drawing-from-noise-and-then-making-animated-loopy-gifs-from-there/). That got me thinking, why don’t I extend the choice of noise implementations in my ruby-processing projects. So for PiCrate I implemented both [OpenSimplex2 versions](https://github.com/KdotJPG/OpenSimplex2). Both these noise implementations seem to be superior to both processing ‘Perlin’ and regular ‘Simplex’ noise.

See example PiCrate sketch:-

```ruby
require 'picrate'
# OpenSimplex has a range -1.0 to 1.0
class NoiseImage < Processing::App
  SCALE = 0.02

  def setup
    sketch_title 'Noise Image'
    background(0)
    stroke(255)
    no_fill
    noise_mode(NoiseMode::OPEN_FAST)
  end

  def draw
    background(0)
    scale = 0.02
    load_pixels
    grid(500, 500) do |x, y|
      col = noise(SCALE * x, SCALE * y) > 0 ? 255 : 0
      pixels[x + width * y] = color(col, 0, 0)
    end
    update_pixels
    save_frame(data_path('OpenFast.png'))
  end

  def settings
    size 500, 500
  end
end

NoiseImage.new

```

OpenFast  
 ![OpenFast](https://canada1.discourse-cdn.com/flex036/uploads/processingfoundation1/original/2X/8/8f5fc28fc322991eaf8777241aa04e00fb54f8f0.png)  
OpenDetail  
 ![OpenFast](https://canada1.discourse-cdn.com/flex036/uploads/processingfoundation1/original/2X/8/8f5fc28fc322991eaf8777241aa04e00fb54f8f0.png)  
Simplex  
 ![simplex](https://canada1.discourse-cdn.com/flex036/uploads/processingfoundation1/original/2X/2/2c51d3336d76b8c962ce7cdce1ed4c5cccee4b7e.png)  
Perlin (really value noise) adjusted sketch for range `0..1 cf `-1.0…1.0`  
 ![perlin](https://canada1.discourse-cdn.com/flex036/uploads/processingfoundation1/original/2X/e/e39de1a3d4768619b50763ff8ffaa6e3257580ac.png)

It should be noted that within OpenSimplex2, there is a possibility of different options within the noise functions, and I have somewhat arbitrarily chosen one of those options. I might explore making those options selectable, and possibly ditch processing ‘Perlin noise’ which lacks that organic feel…
