explaingit

jakubantalik/img-fx

Analysis updated 2026-06-24

12TypeScriptAudience · developerComplexity · 2/5LicenseSetup · easy

TLDR

React component that wraps any card in a WebGL shader canvas which cycles through animated dot or pixel mosaic effects to reveal images from a user-supplied URL pool.

Mindmap

mindmap
  root((img-fx))
    Inputs
      Image URL list
      Preset name
      Theme attribute
      Timing props
    Outputs
      Animated WebGL canvas
      onCycle callback
      Ref handle
    Use Cases
      Card loader effect
      Image reveal hover
      Pixel mosaic backdrop
    Tech Stack
      React
      TypeScript
      ThreeJS
      WebGL
      Vite
Click or tap to explore — scroll the page freely

Code map

Detail Auto

An interactive map of this repo's files and how they connect — its source is parsed live in your browser. Click Visualize to build it.

filefunction / class

What do people build with it?

USE CASE 1

Add an animated dot or pixel loader effect to a product card grid

USE CASE 2

Build a hover-to-reveal image gallery with manual trigger and hide controls

USE CASE 3

Drop a WebGL background mosaic onto a hero section with light and dark theming

USE CASE 4

Cycle through a pool of image URLs on a card with shared WebGL context for low overhead

What is it built with?

ReactTypeScriptThreeJSWebGLVite

How does it compare?

jakubantalik/img-fxalamops/agetoraza-ali/blendpixel.com
Stars121212
LanguageTypeScriptTypeScriptTypeScript
Setup difficultyeasyhardeasy
Complexity2/54/52/5
Audiencedeveloperdeveloperdeveloper

Figures from each repo's GitHub metadata at analysis time.

How do you get it running?

Difficulty · easy Time to first run · 5min

Requires React, ReactDOM, and Three.js as peer dependencies in the host app.

MIT, free to use, modify, and ship in commercial products with attribution.

In plain English

img-fx is a small React library that wraps a card-shaped element in a WebGL canvas and runs an animated shader on top of it. The shader produces what the README calls a generation or loader effect: a moving mosaic of dots or pixels that periodically reveals an image from a pool the user provides. A live demo is hosted at image.jakubantalik.com. Install is npm install img-fx, with React, ReactDOM, and Three.js declared as peer dependencies. The library exports an ImageGeneration component. Wrap any child element in it, set a preset, pass a list of image URLs, and turn on auto-reveal to get the default loop. The README also documents a Vite playground for local development plus build scripts for the library bundle and the demo site. Behaviour is driven by props. preset picks between three bundled shader looks: dots-mechanic, pixels-organic, and pixels-mechanic. theme reads the page's data attribute, class, inline color-scheme, or media query to pick light or dark, and updates live via a MutationObserver. strength is an opacity multiplier. cardBg overrides the card surface colour and keeps the shader's colour-proximity logic in sync. revealDelayRange, revealHoldMs, and revealFadeOutMs control timing. An onCycle callback fires on each phase change. A ref handle exposes manual control. The component accepts a ref whose triggerReveal method runs one full reveal, hold, and hide cycle, with an optional hold: 'manual' mode that pairs with triggerHide. An isImageActive query lets a parent build a reveal-or-hide toggle button without enabling the auto loop. The README closes with notes on performance and scale invariance. Cell size, vignette range, and edge fade are computed in CSS pixels using the device pixel ratio, so a pixels-organic cell looks the same physical size on small and large cards. All instances share a single Three.js WebGL renderer and one WebGL context, frames are capped at 30 fps via a requestAnimationFrame accumulator, off-screen cards are paused by an IntersectionObserver, and image bitmaps are cached by URL across instances. The licence is MIT.

Copy-paste prompts

Prompt 1
Show me a minimal Next.js page that uses ImageGeneration with the pixels-organic preset
Prompt 2
Wire img-fx to a ref so a button calls triggerReveal and triggerHide on click
Prompt 3
Tune revealDelayRange and revealHoldMs to make the reveal cycle pause for 3 seconds
Prompt 4
Add a custom cardBg color to img-fx and explain how that affects the shader proximity logic
Prompt 5
Subscribe to onCycle from img-fx and log each phase change to the console

Frequently asked questions

What is img-fx?

React component that wraps any card in a WebGL shader canvas which cycles through animated dot or pixel mosaic effects to reveal images from a user-supplied URL pool.

What language is img-fx written in?

Mainly TypeScript. The stack also includes React, TypeScript, ThreeJS.

What license does img-fx use?

MIT, free to use, modify, and ship in commercial products with attribution.

How hard is img-fx to set up?

Setup difficulty is rated easy, with roughly 5min to a first successful run.

Who is img-fx for?

Mainly developer.

Open on GitHub → Explain another repo

This repo across BitVibe Labs

Verify against the repo before relying on details.