Groups an image into large pixel cells for a low-resolution pixel-art look.
Also known as: Pixelatepixelationmosaic pixels
Moves in browsers that support WebGPU
This device could not render the demo — showing a still
Code reflects the control values
React
// Renders only in browsers with WebGPU.
// /samples/… are this site’s sample files — point them at your own image or video.
import { Shader, ImageTexture, Pixelate } from 'shaders/react'
export default function ShaderEffect() {
return (
<Shader style={{ width: '100%', height: 320 }} disableTelemetry>
<ImageTexture
objectFit="cover"
url="/samples/still.jpg" />
<Pixelate />
</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, ImageTexture, Pixelate } from 'shaders/vue'
</script>
<template>
<Shader style="width: 100%; height: 320px" :disable-telemetry="true">
<ImageTexture
object-fit="cover"
url="/samples/still.jpg"/>
<Pixelate/>
</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, ImageTexture, Pixelate } from 'shaders/svelte'
</script>
<Shader style="width: 100%; height: 320px" disableTelemetry>
<ImageTexture
objectFit="cover"
url="/samples/still.jpg" />
<Pixelate />
</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, ImageTexture, Pixelate } from 'shaders/solid'
export default function ShaderEffect() {
return (
<Shader style={{ width: '100%', height: '320px' }} disableTelemetry>
<ImageTexture
objectFit="cover"
url="/samples/still.jpg" />
<Pixelate />
</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/still.jpg',
},
},
{
type: 'Pixelate',
}
]
}, { disableTelemetry: true })
Props · Pixelate
Changes apply to the demo above and to the code tabs. Descriptions come from the library registry (MIT).
Name
Value
Default
Range / options
Description
scaleScale
50
1 – 200 (step 1)
Number of pixels along the longest edge (higher = smaller pixels)
gapGap
0
0 – 0.95 (step 0.01)
Space between pixels as a fraction of cell size (0 = no gap, 1 = fully invisible)
roundnessRoundness
0
0 – 1 (step 0.01)
Roundness of each pixel's corners (0 = square, 1 = circle)
Every component also takes blendMode · opacity · visible · maskSource/maskType · boundingBox · id
It redraws a picture as a large square mosaic. Think of an old game screen where each individual pixel is visible.
`scale` defaults to 50 and ranges from 1 to 200 to set the pixel count along the longest edge. Higher values make the pixels smaller and the image more detailed. `gap` defaults to 0 and ranges from 0 to 0.95 to set spacing between cells, while `roundness` defaults to 0 and ranges from 0 to 1 to round each pixel’s corners.
Apply it over an image or video input. Pair it with `Dither` or `Ascii` for a deliberately limited-screen style, but large pixels can blur small text and facial outlines.
When to use
Use it for pixel-art backgrounds, retro game graphics, and mosaic-like image treatments. Avoid it when small text or facial expressions need to stay clear.