Empresas
Empregos
  • Sobre nós
  • Soluções
    • Publicação de vagas
      Publique sua vaga e receba candidatos qualificados em 48h.
    • Avaliações de candidatos
      Mais de 500 testes técnicos e psicológicos, mais anti-fraude.
    • Headhunting
      Busca executiva personalizada do início ao fim.
    • Folha de Pagamento + EOR
      Dispersão de folha e EOR em mais de 15 países da LATAM.
  • Preços
  • Empregos

0

131
Visualizações
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 à pergunta
Encontrar trabalhos remotos

Descubra a nova forma de encontrar um emprego!

melhores empregos
Principais categorias de trabalho
Empresas
Postar vaga Preços Comercial
Jurídico
Termos e Condições Política de privacidade
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomende algumas ofertas para mim
Preciso de ajuda