Skip to content

filter(OPAQUE) darkens semi-transparent colors #6528

@davepagurek

Description

@davepagurek

Most appropriate sub-area of p5.js?

  • Accessibility
  • Color
  • Core/Environment/Rendering
  • Data
  • DOM
  • Events
  • Image
  • IO
  • Math
  • Typography
  • Utilities
  • WebGL
  • Build Process
  • Unit Testing
  • Internalization
  • Friendly Errors
  • Other (specify if possible)

p5.js version

main branch

Web browser and version

Firefox 117

Operating System

macOS 14

Steps to reproduce this

Steps:

  1. Create semi transparent content
  2. Apply filter(OPAQUE)
    It currently is blending with black due to the filter not correctly handling premultiplied alpha.

Snippet:

function setup() {
  createCanvas(400, 400)
}

function draw() {
  clear()
  background(255, 0, 0, 50)
  filter(OPAQUE)
}

Live: https://editor.p5js.org/davepagurek/sketches/mJ1j4EOYl

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions