-
Notifications
You must be signed in to change notification settings - Fork 82
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
Filter parametrization #28
Comments
@andcl Hey Andrés, I started to add this with the new function for https://github.com/davidsonfellipe/lena.js/blob/master/docs/all-filters.html Thanks for reporting |
@davidsonfellipe Very nice job, will keep an eye on it when you arrive to the highpass filter ;) |
@andcl some new filters accepting amount:
|
@andcl alternatively you can create filters based on convolution like this. // npm install 'lena.js'
import { convolution } from 'lena.js';
const customFilter = function (pixels) {
const divider = 15
const operator = [
2 / divider,
4 / divider,
5 / divider,
4 / divider,
2 / divider,
4 / divider,
9 / divider,
12 / divider,
9 / divider,
4 / divider,
5 / divider,
12 / divider,
15 / divider,
12 / divider,
5 / divider,
4 / divider,
9 / divider,
12 / divider,
9 / divider,
4 / divider,
2 / divider,
4 / divider,
5 / divider,
4 / divider,
2 / divider,
]
return convolution(pixels, operator)
}
export default customFilter |
Not really an issue, but a suggestion.
It could be really nice to somehow parametrize the effects and the amount of effect in each one, using one or more selectors for example.
The text was updated successfully, but these errors were encountered: