halftone cmyk

A four-colour process halftone — separates the image into cyan, magenta, yellow and black channels, each with its own ink colour and dot-size controls.

Preview

live
Click the preview to load a random sample image.

Install

npm
npm i @devmischief/shaders-svelte

Code

import { HalftoneCMYK } from '@devmischief/shaders-svelte';

<HalftoneCMYK
  width={1280}
  height={720}
  image="/assets/flowers.webp"
  colorBack="#fbfaf4"
  colorC="#00b3ff"
  colorM="#fc4f9d"
  colorY="#ffd900"
  colorK="#231f20"
  type="ink"
  size={0.2}
  gridNoise={0.2}
  softness={1}
  contrast={1}
  floodC={0.15}
  floodM={0}
  floodY={0}
  floodK={0}
  gainC={0.3}
  gainM={0}
  gainY={0.2}
  gainK={0}
  grainMixer={0}
  grainOverlay={0}
  grainSize={0.5}
  scale={1}
  rotation={0}
  offsetX={0}
  offsetY={0}
  fit="cover"
/>
			
			

Shader Props

23
namedescriptiontypevalues
imageSource image processed into CMYK halftone print.stringurl
colorBackPaper color shown behind the inks.stringhex / rgba
colorCCyan ink color.stringhex / rgb
colorMMagenta ink color.stringhex / rgb
colorYYellow ink color.stringhex / rgb
colorKBlack (key) ink color.stringhex / rgb
typeDot rendering style.stringdots · ink · sharp
sizeHalftone cell size relative to the image.number0 → 1
gridNoiseSmooth noise applied to dot positions and color sampling.number0 → 1
softnessEdge softness of the dots.number0 → 1
contrastContrast applied to the sampled image.number0 → 2
floodCUniform cyan dot size offset. Negative shrinks, positive grows the entire channel.number−1 → 1
floodMUniform magenta dot size offset.number−1 → 1
floodYUniform yellow dot size offset.number−1 → 1
floodKUniform black dot size offset.number−1 → 1
gainCProportional cyan dot size gain. Boosts only where dots already exist.number−1 → 1
gainMProportional magenta dot size gain.number−1 → 1
gainYProportional yellow dot size gain.number−1 → 1
gainKProportional black dot size gain.number−1 → 1
grainMixerGrain distortion applied to dot edges.number0 → 1
grainOverlayPost-process grain overlay on the final output.number0 → 1
grainSizeScale of the grain distortion and overlay.number0 → 1
fitHow the source image is fit into the canvas.stringcover · contain

Common Props

9
namedescriptiontypevalues
scaleOverall zoom level of the graphics.number0.01 → 4
rotationOverall rotation angle of the graphics.number0 → 360
offsetXHorizontal offset of the graphics.number−1 → 1
offsetYVertical offset of the graphics.number−1 → 1
originXReference point for positioning width in the canvas.number0 → 1
originYReference point for positioning height in the canvas.number0 → 1
speedAnimation speed for time-based motion.number
minPixelRatioMinimum pixel ratio used when rendering the shader (default 2).number
maxPixelCountMaximum pixel count the shader may process.number

built with mischief by devmischief

@devmischief/shaders-svelte