HTML5 Canvas Threshold filter Image Tutorial
To apply filter to an Konva.Image
, we have to cache it first with cache()
function. Then apply filter with filters()
function.
To apply a threshold effect to an image with Konva, we can use the Konva.Filters.Threshold
.
The threshold filter converts the image into a black and white image where all pixels above the threshold value become white and all pixels below become black.
Instructions: Slide the control to change threshold value.
For all available filters go to Filters Documentation.
- Vanilla
- React
- Vue