dither
Cuts each channel to a few levels and mixes them in a pattern, as early computer graphics did.
tsx
import { Clip, Composition, Track } from "@uberscene/kit";
// dither: Cuts each channel to a few levels and mixes them in a pattern, as early computer graphics did.
export default function Video() {
return (
<Composition fps={30} width={640} height={360}>
<Track id="main">
<Clip
id="shot"
src="asset:redCup"
in={18}
out={21}
fit="cover"
effects={[
{
type: "dither",
size: 2,
levels: [
{ at: 0.5, value: 64, easing: "easeInOut" },
{ at: 1.5, value: 2 },
],
},
]}
/>
</Track>
</Composition>
);
}The coffee footage is Pixabay videos 209419, 209424, 46989 and 251, under the Pixabay Content License. The maker of the machine in the red cup shot has nothing to do with this project.
Params
Drawn as a shader.
| param | type | default | description |
|---|---|---|---|
levels | integer (2..256) | 2 | How many levels each channel keeps, black and full included; 2 gives eight colours in all. |
size | number (1..64) | 2 | How big each cell of the pattern is, in pixels. |
pattern | "bayer" | "noise" | "bayer" | Where the thresholds come from: bayer is the regular ordered pattern, noise an even grain. |