HTML5 Canvas Tween Blur Filter Tutorial

To tween a filter using Konva, we can simply tween the properties associated with the filter.
In this tutorial, we’ll tween the blurRadius property, which controls the amount of blur applied to the image.

Instructions: mouseover the image to focus it.

Konva Tween Blur Filter Demoview raw
<!DOCTYPE html>
<script src="[email protected]/konva.min.js"></script>
<meta charset="utf-8" />
<title>Konva Tween Filter Demo</title>
body {
margin: 0;
padding: 0;
overflow: hidden;
background-color: #f0f0f0;
<div id="container"></div>
var width = window.innerWidth;
var height = window.innerHeight;

var stage = new Konva.Stage({
container: 'container',
width: width,
height: height,

var layer = new Konva.Layer();

var lion = new Konva.Image({
x: 80,
y: 30,
draggable: true,

var image = new Image();
image.onload = function () {

// the tween has to be created after the node has been added to the layer
var tween = new Konva.Tween({
node: lion,
duration: 0.6,
blurRadius: 0,
easing: Konva.Easings.EaseInOut,

lion.on('mouseover', function () {;

lion.on('mouseout', function () {
image.src = '/assets/lion.png';
Enjoying Konva? Please consider to support the project.