Intervals visible using perlin noise and curveVertex

Hi

I was trying to use perlin noise for the first time using it to gently nudge some coordinates every interval along the y-axis and connecting those with curveVertex.
When I looked at the image I saw those intervals where the curveVertex is drawn (the “ystep” in the code) appeared to be somewhat visible surrounded with blank space. When zooming in on the image it looks like the pixel aliasing of the curves stops at the intervals where it is then drawn as a straight line.

My question is if there is a setting/way that can hide these intervals/smooth them out or is it just a consequence of using curveVertex in this way and should I be looking at trigonometry based waves?

Thank You

CODE using processing.py

w=800
h=850
def setup():
    size(w,h)
    background(255)
    noLoop()

def draw():
    shifter = 0
    xstep = 5
    for x in range(100,700, xstep):
        beginShape()
        noFill()
        ystep = 40
        for y in range(10,850, ystep):
            i = map(noise(y+shifter),0,1,-9, 9)
            curveVertex(x+i,y)
        endShape()
        shifter+=.1

I guess this is the way anti aliasing works.
Try noSmooth()

noSmooth() indeed makes the intervals disappear with the downside of the curves being not so pleasant to look at. I guess it’s just the way it is then. Thanks

Does it help if you render it as an SVG file?

add_library('svg')
...
def setup():
    size(w, h, SVG, 'output.svg')
    ...

Then you can convert output.svg to a high-res raster image (PNG, etc).

1 Like

Currently not familiar with svg, but I will look in to it

1 Like