Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

110
Views
Apply simplex noise to image with ffmpeg

Is there any way to apply simplex noise on image with ffmpeg?

Implementation in JavaScript

export function addGrain(out, image, slice, scale, intensity){
    let simplex = new SimplexNoise(new Alea());
    let od = out.data,
        id = image.data,
        w = image.width,
        h = image.height,
        ox = slice.x,
        oy = slice.y,
        d = Math.min(slice.width, slice.height);

    for(var y = 0; y < h; y++) {
        for(var x = 0; x < w; x++) {
            // reduce noise in shadows and highlights, 4 = no noise in pure black and white
            let i = (y*w+x)*4,
                l = (id[i]+id[i+1]+id[i+2])/768-0.5,
                rx = x + ox,
                ry = y + oy,
                noise = (simplex.noise2D(rx/d*scale, ry/d*scale) +
                         simplex.noise2D(rx/d*scale/2, ry/d*scale/2)*0.25 +
                         simplex.noise2D(rx/d*scale/4, ry/d*scale/4))*0.5;
            // reduce noise in shadows and highlights, 4 = no noise in pure black and white
            noise *= (1-l*l*2);
            noise *= intensity*255;
            od[i] = id[i]+noise; // R
            od[i+1] = id[i+1]+noise; // G
            od[i+2] = id[i+2]+noise; // B
        }
    }
}

I've idea to do it with generic equation on each pixel geq but i need to get simplex noise value that is calculated from pixel's X and Y

Resources

  • simplex-noise package in JS
about 4 years ago · Juan Pablo Isaza
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!