ShaderX
0.1.3indexedGPU shader effects for Compose: Modifier-style API with built-in effects (blur, grayscale, pixelate, wave), type-safe parameters, animations, shader-factory caching, and custom shader support.
GPU shader effects for Compose: Modifier-style API with built-in effects (blur, grayscale, pixelate, wave), type-safe parameters, animations, shader-factory caching, and custom shader support.
Turn images, text, and Compose UI into print textures, moving surfaces, or your own AGSL/SkSL effects. Shared Kotlin API for Android, iOS, desktop, and WebAssembly.
Gallery · Get started · Live app demos · Documentation
Custom materials, animated type, grain and motion—then the tools to make them your own. Open a preview for a closer look, or follow its effect link for the recipe.
Effect recipes and platform limits.
More effect comparisons: gradients, plasma, grayscale, blur, sepia and pixelation. Try the apps below.
0.2.0 is available on Maven Central. Release notes · Publication status.
Add Maven Central to your repositories, then add ShaderX to commonMain.dependencies in your shared module:
implementation("io.github.debanshu777:shaderx:0.2.0")
Android requires API 31+ for native blur, API 33+ for AGSL, compile SDK 35+, and Java 17 bytecode; iOS, JVM desktop, and Wasm use Skia. Contributor builds use JDK 21; the current checkout uses Kotlin 2.3.21 / Compose Multiplatform 1.10.3. Setup and version catalogs.
Pass your existing Compose resource or image-loader Painter:
import androidx.compose.foundation.Image
import androidx.compose.runtime.Composable
import androidx.compose.ui.Modifier
import androidx.compose.ui.graphics.painter.Painter
import com.debanshu.shaderlab.shaderx.compose.shaderEffect
import com.debanshu.shaderlab.shaderx.effect.impl.GrayscaleEffect
@Composable
fun GrayscalePhoto(painter: Painter, modifier: Modifier = Modifier) {
Image(
painter = painter,
contentDescription = ,
modifier = modifier.shaderEffect(GrayscaleEffect(intensity = )),
)
}
Swap in SepiaEffect(), NativeBlurEffect(radius = 8f), or PixelateEffect(pixelSize = 12f). The same modifier works on text, cards, and other Compose content.
Gradle repository setup
Add Maven Central to your repositories in settings.gradle.kts:
dependencyResolutionManagement {
repositories {
google()
mavenCentral()
}
}
Pause, seek and respect reduced motion
The ordinary modifier animates built-ins with Modifier.shaderEffect(WaveEffect(amplitude = 5f, frequency = 9f)).
For retained pause/seek/speed control, keep playback outside changing effect values. The host supplies lifecycle and reduced-motion preferences.
import androidx.compose.foundation.Image
import androidx.compose.runtime.Composable
import androidx.compose.ui.Modifier
import androidx.compose.ui.graphics.painter.Painter
com.debanshu.shaderlab.shaderx.compose.controlledShaderEffect
com.debanshu.shaderlab.shaderx.compose.rememberShaderPlayback
com.debanshu.shaderlab.shaderx.effect.impl.WaveEffect
{
playback = rememberShaderPlayback(active = active, reducedMotion = reducedMotion)
Image(
painter, ,
modifier = Modifier.controlledShaderEffect(
WaveEffect(amplitude = , frequency = ), playback,
),
)
}
Optional controls use playback.isPlaying = false, playback.seekTo(2.5), and playback.speed = 0.5. Playback, live inputs, and ownership.
Effects and custom authoring
| Family | Effects |
|---|---|
| Color and image | Grayscale, sepia, gradient, vignette, pixelation, chromatic aberration, invert, native blur |
| Motion and audio | Wave, animated gradient, plasma, ripple, vortex, audio visualizer/distortion |
| Color and print collection |
ShaderX provides editable custom definitions, controlled playback, procedural backgrounds, explicit data/child inputs, ordered Skia chains, support/fallback reports, and bounded Skia PNG export. Platform limits · Upgrade guide · Release history.
Try the controls yourself in ShaderX Sampler or ShaderLab. Sampler walks through Basic, Custom, Animation and Chain; ShaderLab lets you tune effects, edit shader source and build ordered pipelines.
Prefer running locally? Download the source ZIP and follow the desktop and Android setup. See separate run instructions for ASCII camera and movie carousel.
Custom shaders · Compose and animation · Image processing · Coil and Haze · Troubleshooting
Contribute through CONTRIBUTING.md and the setup and validation guide. Every code change updates this README and affected guides. Release checks keep the build version, install snippets and changelog aligned; compatibility tests retain published modifier callbacks and Wave copy/destructuring. CI smoke-tests the installed sandboxed Chrome on both OSes and bounds macOS native-build concurrency. Gallery recipes and capture provenance record effect boundaries and validation limits. · · .
![]() Gold foil membership Custom foil |
![]() Chromatic type specimen Custom scan |
![]() Skincare product preview Ripple |
![]() Atmospheric focus Animated layered noise |
![]() Stippled botanical print Static stochastic noise |
![]() Halftone art print Halftone |
![]() Arcade call to action Wave distortion |
![]() Dithered platformer Ordered dither |
![]() Chromatic record player Chromatic aberration |
![]() Citrus color editor Color adjustment |
| Color adjustment/matrix, ordered dither, halftone |
![]() ShaderX Sampler Four playable examples |
![]() ShaderLab playground Gallery · Source · Pipeline |
![]() Optical print proof Blur → dots / dots → blur · Try in ShaderLab |
![]() ShaderLab · narrow browser Explore the playground · Sample app |
![]() Live ASCII camera CameraX + custom shader · Sample app |
![]() Scroll-driven movie cards Scroll + shader parameters · Sample app |
Surfaced from shared tags and platforms — no rankings paid for.