ANTLII
CONTACT
REFRACTINFO
  1. Overview

REFRACT Tool

REFRACT is a web-based generative tool built on p5.js for processing images with displacement filters and shader-based refraction effects. You can import images from your device or load an example photo, then adjust the filters to create still compositions or animation.

REFRACT lets you save individual frames as raster images, or export animations as MP4 video or image sequences in ZIP archives for later assembly into a video using a tool like FFmpeg.

The tool includes ready-to-use presets as starting points for your own compositions. You can save and load your own effect settings as JSON presets. The source image is not included in the preset.

In Frame mode, the animation is paused. The preview updates when you change settings, select another frame, load an image or apply a preset. You can also use Select Frame to choose which moment of the animation to export. Video and Frame Sequence use a live animation preview.

A complete video or frame-sequence export starts at the beginning of the animation and covers the selected Duration. Changing Duration can also change the motion of the Box and Flow effects.

Performance and compatibility

REFRACT accepts JPG, PNG and WebP images, including images with transparency. Rendering performance depends on the image dimensions, the effects you use, your hardware and your browser.

  • Image Size: Max Image Size sets the maximum resolution along the longest side of an image. Larger images are scaled down when loaded. Lower this setting before reloading a large image to reduce memory use and processing demands. Changing the setting does not resize an image that is already loaded.
  • Video Export: MP4 export requires a browser and device with a compatible WebCodecs AVC encoder. Availability varies with the output dimensions. High-resolution or long videos may also run out of memory. If export fails, try reducing Export Scale or the duration. For large or high-resolution projects, you can export a PNG sequence and convert it to video separately using FFmpeg.
  • Frame Sequences: Frame sequences are saved in ZIP archives. ZIP Part Size sets the maximum size of each archive, allowing a long sequence to be split into smaller downloads.
  • WebP Export: WebP requires native browser support. If it is unavailable, use PNG instead.
  • Transparency: The canvas background is included in the export. PNG and supported WebP exports preserve transparency. JPG and MP4 render transparent areas in black.
  • Mobile Support: The tool is designed for desktop browsers and isn’t optimized for mobile devices.

Please let me know if you're running into any issues or discover a bug while using the program.

Credits

I would like to acknowledge the use of several third-party libraries and materials within this project and express my sincere gratitude to their creators for making these resources available:

  • The p5.js ↗ Creative Coding Library;
  • Shader examples ↗ for WebGL by Adam Ferriss;
  • Jonas Wagner’s Simplex Noise ↗ algorithm;
  • The Tweakpane ↗ interface library by Hiroki Kokubun;
  • The Mediabunny ↗ library, used by CanvasExport to encode MP4 video;
  • fflate ↗ by Arjun Barrett for bundling exported frames into ZIP archives.

And a big thanks to the Unsplash ↗ platform and its contributors for making their images available for use in this project.

Technical details

Version
0.26
Inputs
Images
Exports
PNG / JPG / WebP · MP4 · PNG / JPG / WebP sequence (ZIP)
Presets
JSON
Built with
p5.js · JavaScript