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

121
Views
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
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!