Enhance your visuals with these JavaScript image effects that go beyond basic styling. From smooth hover transitions and glitch effects to canvas-based manipulations and scroll animations, this collection shows how JavaScript can bring images to life with interactivity, depth, and motion.
29 JavaScript Image Effects
3D Glass Photo Lens
demo & codeThis 3D Glass Photo Lens creates a stunning, tactile digital object - a thick glass block that refracts user-uploaded photos. Built with Three.js, it simulates the physics of light (transmission, IOR, thickness) to produce high-fidelity glass renders directly in the browser. Users can change the lens shape (Heart, Square, Hexagon), adjust the glass tint, and even modify the environmental lighting to see how reflections dance across the beveled edges.
Ink Transition Scroll Effect
demo & codeThis Ink Transition Scroll Effect brings digital storytelling to life by mimicking the organic spread of ink on paper. Designed for a biography page, it reveals images using a “splatter” transition triggered by scrolling. It combines ScrollMagic for timing, GSAP for smooth text entry, and CSS Sprites for the complex ink mask animation.
Interactive Canvas Liquid Image Distortion
demo & codeThis Interactive Canvas Liquid Image Distortion transforms a static image into a playful, fluid surface. By subdividing the image into a grid of tiny cells, the script manipulates the texture coordinates of each cell in response to mouse movement. The result is a “jelly-like” or refractive glass effect where the image appears to warp and ripple under the user’s cursor.
Glitch Image Hover Effect with Shaders
A calm static image that, upon hover, jitters, splits into RGB channels in bands, and slowly zooms in, evoking a digital glitch or cyberpunk atmosphere.
See the Pen Glitch Image Hover Effect with Shaders.
Image Hover Effect with Shaders
An interactive “liquid” image distortion effect powered by Three.js and custom GLSL shaders.
See the Pen Image Hover Effect with Shaders.
Extreme Hover with HTML and CSS
A visually dynamic and impressive effect where hovering over a static image transforms it into a complex, 3D-like collage, showcasing the capabilities of CSS transitions and imperative loading control.
See the Pen Extreme Hover with HTML and CSS.
Image Hover Effect
A unique, visually impressive effect where the user moves a “liquid,” morphing lens to compare two scenes, demonstrating advanced use of SVG and DOM manipulation for visual UX.
See the Pen Image Hover Effect.
Shaders Example #15
A highly specialized, GPU-accelerated image transition component built on Three.js.
See the Pen Shaders Example #15.
Photo Inview Animation: Venetian Blinds Effect
A high-end, editorial-style web design where content appears smoothly and coordinately, creating a sense of premium quality and attention to detail.
See the Pen Photo Inview Animation: Venetian Blinds Effect.
p5.js Glitch Image
A real-time glitch art generator powered by p5.js, manipulating image data at the pixel level.
See the Pen p5.js Glitch Image.
Dynamic SVG Glitch Effect
A dynamic, broken image featuring twitching scanlines, color channel shifts, and geometric distortions, reminiscent of digital signal interference or vintage TV static.
See the Pen Dynamic SVG Glitch Effect.
Fancy Image Hover Effects with Splitting.js
Explore a variety of sophisticated hover effects, where complex animation patterns are created using advanced CSS selectors like :nth-child(-n + 3). These selectors target specific ranges of “cells” generated by Splitting.js.
See the Pen Fancy Image Hover Effects with Splitting.js.
Generative Glitch Effect with p5.js
Experience a dynamic, generative glitch effect where the visuals are created in real-time within the p5.js draw() loop. The animation combines a sequence of pixel shifts, line flows, and RGB channel separation to create a unique, non-repeating visual every time the code runs.
See the Pen Generative Glitch Effect with p5.js.
SVG Mask Image Slideshow
This captivating slideshow is powered by a gsap.timeline that orchestrates a sophisticated “wipe” transition using an SVG <mask>. The timeline animates the xPercent of dynamically generated <rect> elements to reveal an image, while a simple setInterval function cycles through an array of content, updating the text and image source every 10 seconds to create a seamless, self-playing visual loop.
See the Pen SVG Mask Image Slideshow.
SVG Mask Waterfall Image Reveal
This captivating waterfall-style image reveal showcases a powerful synergy between technologies. A JavaScript for loop procedurally generates a series of <rect> elements within an SVG <mask>, which are then animated by GSAP in a continuous, yoyo-ing loop. The mesmerizing, chaotic effect is achieved using a random stagger (from: 'random') and a dramatic expo.easeInOut ease, creating a seamless and performant animation.
See the Pen SVG Mask Waterfall Image Reveal.
Image Displacement with Three.js
A texture morphing effect with 3D rotation on hover, implemented using Three.js and shaders (GLSL). The fragment shader uses the snoise3 function (simplex noise) to create an organic mixing mask for blending two images.
See the Pen Image Displacement with Three.js.
GSAP Sprite Mask Animation
The demo uses GSAP to programmatically control the CSS mask property and applies the ease: steps() function for precise, frame-by-frame switching between 20 sprite mask states, creating a drawing or layered revelation effect.
See the Pen GSAP Sprite Mask Animation.
LUME Shiny 3D Image Grid (Webgl, Three.js)
A high-performance 3D gallery leveraging WebGL for rendering an interactive image grid with a reflective (shader) effect and realistic cursor-driven lighting, implemented atop LUME.
See the Pen LUME Shiny 3D Image Grid (Webgl, Three.js).
Animating WebGL Shaders with GSAP
Dynamic control over GPU effects, including 3D-deforming ripples (Vertex Shader) on click and animated reveal masks by smoothly driving shader uniforms with GSAP timelines.
Efficient Image Scroll Zoom Effect
A demo of the scroll zoom effect via dynamic element visibility calculation and utilizing the Intersection Observer API for performance enhancement.
See the Pen Efficient Image Scroll Zoom Effect.
Repetition Image Animation
Technically, this GSAP and vanilla JS demo creates a multi-layered parallax effect, where each layer responds to mouse movement, and a drag gesture adds complex 3D rotation. The code is flexible, allowing you to switch between different shapes and visual styles.
See the Pen Repetition Image Animation.
Liquid Glass Shader
This demo is a powerful example of using WebGL for image processing directly on the GPU with shaders, which allows for impressive effects like a lens and light flares with high performance.
See the Pen Liquid Glass Shader.