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

126
Vistas
Node Canvas context filters don't do anything in NodeJS

When trying to use canvas to blur an image of text in NodeJS, it simply does nothing. This is an example of a Discord bot that's supposed to return a blurred image of the text "Hello World" in SansSerif, but what it actually returns is this

    //create canvas and context
    let cnvs = canvas.createCanvas(740, 260)
    let ctx = cnvs.getContext('2d')

    //set the context filter to blur
    ctx.filter = 'blur(10px)';
    //set the context font to sans serif size 48
    ctx.font = '48px serif';
    //add the text on the image
    ctx.fillText('Hello world', 50, 100);

    //send the image as a message attachment
    message.channel.send({files: [{ attachment: cnvs.toBuffer() }]}).catch(allerrors)

None of the other context filters work either, all return the exact same image. I don't get any errors or warnings, it acts as if everything worked as intended.

Does anyone know what could cause this? Is there another workaround for turning an image grayscale, changing the hue or blurring it?

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