Function glitch

  • Glitch canvas image

    Example

    const ctx = canvasWithSomethingRendered.getContext("2d")
    pgul.canvasHelper.glitch.call(ctx, 16, 1, 4)

    Example

    Context2D prototype extension
    // TODO

    Parameters

    • this: CanvasRenderingContext2D
    • chipSize: number
    • seed: number = ...

      Random seed

    • Optional discreteFreq: number

      Skips rendering with probability of 1/[specified value]. Effective when value is over 0 (i.e. negative value is skipped)

    • srcImage: HTMLCanvasElement | HTMLImageElement = ...

      Use itself if undefined

    • override: boolean = false

    Returns void

Generated using TypeDoc