Nodes/Jovi_GLSL/PIXELATE (JOV_GL)
ComfyUI Node

PIXELATE (JOV_GL)

Pixelate input image

By Amorano·Created 2 years ago·Updated 12 months ago· 20
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)

NameTypeDefaultDescription
imageoptIMAGERGB(A) image
amountoptFLOAT32.00–255Pixel data range allowed
FRAGMENToptSTRING// 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)

NameTypeDescription
RGBAIMAGEFull channel [RGBA] image. If there is an alpha, the image will be masked out with it when using this output.
RGBIMAGEThree channel [RGB] image. There will be no alpha.
MASKMASKSingle channel mask output.