ComfyUI Node
PIXELATE (JOV_GL)
Pixelate input image
PIXELATE (JOV_GL)
- image
- RGBA
- RGB
- MASK
◄amount32.0►
◄FRAGMENT// name: PIXELATE
// desc: Pixelate input image
// category: COLOR
uniform sampler2D image; // | RGB(A) image
uniform float amount; // 32;0;255;0.1 | Pixel data range allowed
void mainImage( out vec4 fragColor, in vec2 fragCoord )
{
vec2 uv = fragCoord / iResolution.xy;
float d = 1.0 / amount;
float ar = iResolution.x / iResolution.y;
float u = floor( uv.x / d ) * d;
float v = floor( uv.y / d ) * (ar / amount);
fragColor = texture( image, vec2( u, v ) );
}
►
CategoryJOV_GL 🌈/COLOR
Inputs (3)
| Name | Type | Default | Description |
|---|---|---|---|
| imageopt | IMAGE | RGB(A) image | |
| amountopt | FLOAT | 32.00–255 | Pixel data range allowed |
| FRAGMENTopt | STRING | // name: PIXELATE // desc: Pixelate input image // category: COLOR uniform sampler2D image; // | RGB(A) image uniform float amount; // 32;0;255;0.1 | Pixel data range allowed void mainImage( out vec4 fragColor, in vec2 fragCoord ) { vec2 uv = fragCoord / iResolution.xy; float d = 1.0 / amount; float ar = iResolution.x / iResolution.y; float u = floor( uv.x / d ) * d; float v = floor( uv.y / d ) * (ar / amount); fragColor = texture( image, vec2( u, v ) ); } | — |
Outputs (3)
| Name | Type | Description |
|---|---|---|
| RGBA | IMAGE | Full channel [RGBA] image. If there is an alpha, the image will be masked out with it when using this output. |
| RGB | IMAGE | Three channel [RGB] image. There will be no alpha. |
| MASK | MASK | Single channel mask output. |