A very fast & simple tilt-shift effect in Canvas.
Click and move the cursor on the canvas above to define the start and end point of the focus area.
The original image of Jodhpur rooftops by Paul Goyette is under Creative-Common.
A blurred version of the original image is generated using Canvas and
drawImage(), upon rendering the tilt-shift image, a gradient is generated based on the user defined start and end points and used as a mask to show the blurred image on top of the original image. Simple.
The blurred image is generated incrementally to improve the quality of the blurring effect. Without this, it would feature heavy bilinear interpolation approximations.
This effect is more a proof of concept than an attempt to match exactly the optical properties of a real tilt-shift effect. For instance it does not use a depth map and thus can not properly process images showing tall structures. However the results are quite convincing for such a simple piece of code.
Other recent experiments
There are many experiments and projects like TILT SHIFT to discover other here.
- FRONTFEST MOSCOW It was an honour to be invited to Fronfest Moscow 2017 with the little family to give my first workshop; implementing a Twin-stick shooter using ES6 and Canvas, and to continue my CODE🎙ART series of talks + live coding aiming to inspire new web developer artists.
- BREATHING EARTH Another take on Nadieh Bremer mesmerizing Breathing Earth visualisation, running at 60fps on a 2D Canvas without libraries or frameworks.
- CODING⬢ART AT SCRIPT'17 Script'17 was all kinds of awesome: Great organization, line up, venue, catering, diverse and welcoming. It was a pleasure to talk to you all and LIVE code something useless before the party. Looking forward to see useless things from you all.
- RUBBER IN SOLID # A crazy twister effect in 256bytes of DHTML
- MAGIC A cute little intro for the Magic BBS made in 3.5kb for MSDOS
Don't be shy; get in touch by mail, twitter, github, linkedin or pouet if you have any questions, feedback, speaking, workshop or performance opportunity.