q5play
    Preparing search index...

    Function filter

    • 🌆 Applies a filter to the image.

      See the documentation for q5's filter constants below for more info.

      A CSS filter string can also be used. https://developer.mozilla.org/docs/Web/CSS/filter

      Not applicable to WebGPU canvases.

      Parameters

      • type: string

        filter type or a CSS filter string

      • Optionalvalue: number

        optional value, depends on filter type

      Returns void

      await Canvas(200);
      let logo = await load('/q5js_logo.avif');
      logo.filter(INVERT);
      image(logo, -100, -100, 200, 200);