Chromatic Aberration

색수차

Separates the red, green and blue channels so edges show a prism-like color split.

Also known as: ChromaticAberrationRGB splitColor fringing

Moves in browsers that support WebGPU

This device could not render the demo — showing a still

React
// Renders only in browsers with WebGPU.
// /samples/… are this site’s sample files — point them at your own image or video.
import { Shader, ChromaticAberration, ImageTexture } from 'shaders/react'

export default function ShaderEffect() {
  return (
    <Shader style={{ width: '100%', height: 320 }} disableTelemetry>
      <ImageTexture
        objectFit="cover"
        url="/samples/poster.jpg" />
      <ChromaticAberration />
    </Shader>
  )
}
Vue
<!-- Renders only in browsers with WebGPU. -->
<!-- /samples/… are this site’s sample files — point them at your own image or video. -->
<script setup lang="ts">
import { Shader, ChromaticAberration, ImageTexture } from 'shaders/vue'
</script>

<template>
  <Shader style="width: 100%; height: 320px" :disable-telemetry="true">
    <ImageTexture
      object-fit="cover"
      url="/samples/poster.jpg"/>
    <ChromaticAberration/>
  </Shader>
</template>
Svelte
<!-- Renders only in browsers with WebGPU. -->
<!-- /samples/… are this site’s sample files — point them at your own image or video. -->
<script>
  import { Shader, ChromaticAberration, ImageTexture } from 'shaders/svelte'
</script>

<Shader style="width: 100%; height: 320px" disableTelemetry>
  <ImageTexture
    objectFit="cover"
    url="/samples/poster.jpg" />
  <ChromaticAberration />
</Shader>
Solid
// Renders only in browsers with WebGPU.
// /samples/… are this site’s sample files — point them at your own image or video.
import { Shader, ChromaticAberration, ImageTexture } from 'shaders/solid'

export default function ShaderEffect() {
  return (
    <Shader style={{ width: '100%', height: '320px' }} disableTelemetry>
      <ImageTexture
        objectFit="cover"
        url="/samples/poster.jpg" />
      <ChromaticAberration />
    </Shader>
  )
}
JavaScript
// Renders only in browsers with WebGPU.
// /samples/… are this site’s sample files — point them at your own image or video.
// expects <canvas id="canvas" style="width:100%;height:320px"></canvas> on the page
import { createShader } from 'shaders/js'

const shader = await createShader(document.getElementById("canvas"), {
  components: [
    {
      type: 'ImageTexture',
      props: {
        objectFit: 'cover',
        url: '/samples/poster.jpg',
      },
    },
    {
      type: 'ChromaticAberration',
    }
  ]
}, { disableTelemetry: true })

Props · ChromaticAberration

Changes apply to the demo above and to the code tabs. Descriptions come from the library registry (MIT).

NameValueDefaultRange / optionsDescription
strengthStrength0.20 – 1 (step 0.01)Overall strength of the chromatic aberration effect
angleAngle00 – 360 (step 1)Direction of the chromatic aberration in degrees
redOffsetRed Offset-1-2 – 2 (step 0.1)Red channel offset multiplier
greenOffsetGreen Offset0-2 – 2 (step 0.1)Green channel offset multiplier
blueOffsetBlue Offset1-2 – 2 (step 0.1)Blue channel offset multiplier

Every component also takes blendMode · opacity · visible · maskSource/maskType · boundingBox · id

The edges look like white lettering printed in slightly misaligned red and blue ink. It is the color fringing seen through imperfect lenses, or added deliberately to make a digital image feel unsettled.

`strength` defaults to 0.2 (range 0–1); raising it separates the channels further. `angle` defaults to 0° (0–360°) and rotates the split direction. `redOffset` and `blueOffset` default to -1 and 1 (both -2–2), setting each channel's offset and direction; `greenOffset` defaults to 0 (-2–2), so green can stay centered.

Place it over an image or video; crisp light-dark edges make the split easiest to see. Keep `strength` low on text and small icons, and pair it lightly with a vignette or film grain for a lens-like finish.

When to use

Use it to add a lens-like edge to photos and video, or a restrained retro distortion to posters and titles. Avoid it where small text must remain easy to read.

Open as page ↗