Solarize inverts tones above a luminance threshold and blends the result with the original.
Also known as: Solarizesolarization
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, Solarize } from 'shaders/react'
export default function ShaderEffect() {
return (
<Shader style={{ width: '100%', height: 320 }} disableTelemetry>
<ImageTexture
objectFit="cover"
url="/samples/photo.jpg" />
<Solarize
threshold={{
type: "auto-animate",
mode: "ping-pong",
outputMin: 0.2,
outputMax: 0.9,
speed: 0.6
}} />
</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, Solarize } from 'shaders/vue'
</script>
<template>
<Shader style="width: 100%; height: 320px" :disable-telemetry="true">
<ImageTexture
object-fit="cover"
url="/samples/photo.jpg"/>
<Solarize
:threshold="{
type: 'auto-animate',
mode: 'ping-pong',
outputMin: 0.2,
outputMax: 0.9,
speed: 0.6
}"/>
</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, Solarize } from 'shaders/svelte'
</script>
<Shader style="width: 100%; height: 320px" disableTelemetry>
<ImageTexture
objectFit="cover"
url="/samples/photo.jpg" />
<Solarize
threshold={{
type: "auto-animate",
mode: "ping-pong",
outputMin: 0.2,
outputMax: 0.9,
speed: 0.6
}} />
</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, Solarize } from 'shaders/solid'
export default function ShaderEffect() {
return (
<Shader style={{ width: '100%', height: '320px' }} disableTelemetry>
<ImageTexture
objectFit="cover"
url="/samples/photo.jpg" />
<Solarize
threshold={{
type: "auto-animate",
mode: "ping-pong",
outputMin: 0.2,
outputMax: 0.9,
speed: 0.6
}} />
</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/photo.jpg',
},
},
{
type: 'Solarize',
props: {
threshold: {
type: 'auto-animate',
mode: 'ping-pong',
outputMin: 0.2,
outputMax: 0.9,
speed: 0.6
},
},
}
]
}, { disableTelemetry: true })
Props · Solarize
Changes apply to the demo above and to the code tabs. Descriptions come from the library registry (MIT).
Name
Value
Default
Range / options
Description
thresholdThreshold
Auto-animated in the demo — moving it pins the value
0.5
0 – 1 (step 0.01)
Luminance level above which colors are inverted. Pixels brighter than this threshold get flipped.
strengthStrength
1
0 – 1 (step 0.01)
Blend between original (0) and fully solarized (1)
Every component also takes blendMode · opacity · visible · maskSource/maskType · boundingBox · id
Some bright tones invert while others remain, creating an unusual mix of contours and colors like a darkroom solarization print. It affects part of the range rather than flipping every color.
`threshold` defaults to 0.5 and ranges from 0 to 1 for the luminance level above which tones invert. `strength` defaults to 1 and ranges from 0 to 1 to blend the original with the solarized result. Moving the threshold shifts the affected range; lowering strength preserves more of the original.
Apply it over a photo or video. A threshold that does not match the scene brightness may affect too little or too much of the frame. Compare it with Invert to see the difference between a partial tonal inversion and a full color inversion.
When to use
Use it for experimental darkroom-like photos, graphics that emphasize selected bright areas, or a partial color inversion. Avoid it when product colors need to remain natural and consistent.