Empresas
Empleos
  • Sobre nosotros
  • Soluciones
    • Publicación de vacantes
      Publica tu vacante y recibe candidatos calificados en 48h.
    • Evaluación de candidatos
      500+ pruebas técnicas y psicológicas, más anti-fraude.
    • Headhunting
      Búsqueda ejecutiva a la medida de principio a fin.
    • Nómina + EOR
      Dispersión de nómina y EOR en más de 15 países de LATAM.
  • Precios
  • Empleos

0

114
Vistas
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
Responde la pregunta
Encuentra empleos remotos

¡Descubre la nueva forma de encontrar empleo!

Top de empleos
Top categorías de empleo
Empresas
Publicar vacante Precios Comercial
Legal
Términos y condiciones Política de privacidad
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomiéndame algunas ofertas
Necesito ayuda