Skip to content

Discrepancies with shader-based THRESHOLD, ERODE, and DILATE Filters at higher pixel densities #6398

Closed
@SableRaf

Description

@SableRaf

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

1.7.x Beta: https://raw.githubusercontent.com/wong-justin/p5.js/shader-filters-build/lib/p5.js

Web browser and version

Chrome Version 116.0.5845.140 (Official Build) (arm64)

Operating System

MacOS Ventura 13.4 (22F66)

Steps to reproduce this

Note: this is a follow up to the conversation on #6324

Big thanks to @wong-justin, @aferriss, and @aceslowman for getting the shader-based filters up and running in p5.js

I've spotted some quirks in the outputs of filter(THRESHOLD), filter(ERODE), and filter(DILATE) when we increase the pixel density. At pixelDensity(1), things look similar to the CPU-based filter, but once we increase the density, some discrepancies start to appear in the output.

For more clarity, I've put together a demo sketch here. You can also see the differences in this generated images:

pixelDensity(1)

image

pixelDensity(2)

image

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    Status

    DONE! 🎉

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions