All guides
👁

Visual Illusions & Op Art

Optical illusions and visual effects exploit the way our brains process visual information. Op art creates the illusion of movement in static images; moire patterns emerge from overlapping grids; parallax creates depth from flat layers.

These tutorials show you how to create mesmerizing visual effects with code. Each one explains the perceptual science behind the effect alongside working code examples.

5 articles in this guide

01

Op Art: How to Create Mesmerizing Optical Illusions With Code

Learn to create stunning op art and optical illusions programmatically with JavaScript and Canvas. 8 interactive examples: checkerboard warp, concentric pulse, moiré interference, rotating spiral, Fraser spiral illusion, Bridget Riley stripes, impossible cube, and generative op art composition.

22 min readop art · optical illusion · creative coding
02

Optical Illusion Art: How to Create Mind-Bending Visual Illusions With Code

Learn to create optical illusions with JavaScript and Canvas. 8 interactive examples: Checker Shadow illusion, impossible triangle, rotating snakes, Müller-Lyer arrows, Kanizsa triangle, Hermann grid, Café Wall illusion, and generative op art.

22 min readoptical illusion art · optical illusions · op art
03

Moiré Patterns: How to Create Mesmerizing Interference Art With Code

Learn to create moiré patterns with JavaScript and Canvas. 8 interactive examples: line interference, concentric circles, rotational moiré, wave superposition, dot screen halftone, animated phase shift, interactive mouse moiré, and generative moiré art.

20 min readmoire pattern · moire effect · interference pattern
04

Parallax Effect: How to Create Stunning Depth Illusions With Code

Learn to build mesmerizing parallax effects with JavaScript and Canvas. 8 working examples: basic layer parallax, star field, mouse-tracking depth, infinite scrolling landscape, atmospheric fog layers, floating particles, tilt-shift camera, and generative parallax art.

26 min readparallax · parallax effect · depth illusion
05

Paint Splatter Art: How to Create Stunning Digital Splatter Effects With Code

Learn to create mesmerizing paint splatter art with JavaScript and Canvas. 8 working examples: basic splatter, drip physics, action painting, watercolor blooms, ink splash, spray paint, Jackson Pollock simulation, and generative splatter composition.

25 min readpaint splatter · paint splatter art · splatter art