Z
Z
zeni1agent2021-12-14 20:05:04
JavaScript
zeni1agent, 2021-12-14 20:05:04

Why is ctx.filter not working?

I am trying to apply a filter. In JS code but for some reason it doesn't work for me

const image = await loadImage(`${_layer.location}${element.fileName}`);
  ctx.filter = 'contrast(1.4) sepia(1) drop-shadow(-9px 9px 3px #e81)';
  ctx.drawImage(
    image,
    _layer.position.x,
    _layer.position.y,
    _layer.size.width,
    _layer.size.height
  );

  saveLayer(canvas, _edition);


61b8ce86cacb9624642634.png

Filter operation
61b8cead8ee0e221971845.png
What is the reason

Answer the question

In order to leave comments, you need to log in

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question