Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Context filters don't do anything in NodeJS #1991

Closed
Aci-yt opened this issue Feb 12, 2022 · 1 comment
Closed

Context filters don't do anything in NodeJS #1991

Aci-yt opened this issue Feb 12, 2022 · 1 comment

Comments

@Aci-yt
Copy link

Aci-yt commented Feb 12, 2022

When using ctx.filter, none of the filters actually change the final image.
Trying a simple thing such as blurring text or turning an image grayscale is complicated enough, but the filters that are supposed to do it, simply don't.
In my case, using canvas to let a Discord bot return a blurred image of "Hello World" in SansSerif only returns a clear image of the text.

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

    ctx.filter = 'blur(10px)';
    ctx.font = '48px serif';
    ctx.fillText('Hello world', 50, 100);

    message.channel.send({files: [{ attachment: cnvs.toBuffer() }]}).catch(allerrors)

Returns this image.

Replacing ctx.filter = 'blur(10px)'; with any other filter has the same effect: none

Your Environment

  • Version of node-canvas: 2.9.0
  • Environment: Node.js v16.6.2
@zbjornson
Copy link
Collaborator

Node-canvas doesn't support the filter API yet, dupe of #1063.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants