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

this.sharpen is not a function #234

Open
bumblebeehub opened this issue Aug 9, 2019 · 1 comment
Open

this.sharpen is not a function #234

bumblebeehub opened this issue Aug 9, 2019 · 1 comment

Comments

@bumblebeehub
Copy link

bumblebeehub commented Aug 9, 2019

Hi, I include CamanJs using this:
<script src="../../node_modules/caman/dist/caman.full.min.js"></script>
<script src="../../node_modules/caman/dist/caman.js"></script>.
and use sharpen like this:
this.sharpen(15)
But I still got this error:

this.sharpen is not a function

Why?

@boulderwebdev
Copy link

You can create a single sharpen filter using

Caman.Filter.register("sharpen", function () {
  this.processKernel("Sharpen", [
    0, -1, 0,
    -1, 5, -1,
    0, -1, 0
  ]);
});

Unfortunately, you will need to fine tune the sharpening process by playing around with the constant 5. The closer to 4 it gets, the sharper the image gets, and the farther away, towards infinity, you get a blurring effect. You can find more info at https://www.html5rocks.com/en/tutorials/canvas/imagefilters/

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

No branches or pull requests

2 participants