Skip to content

[p5.js 2.0+ Bug Report]: noTint() breaks WebGL rendering #8814

@davepagurek

Description

@davepagurek

Most appropriate sub-area of p5.js?

  • Accessibility
  • Color
  • Core/Environment/Rendering
  • Data
  • DOM
  • Events
  • Image
  • IO
  • Math
  • Typography
  • Utilities
  • WebGL
  • WebGPU
  • p5.strands
  • Build process
  • Unit testing
  • Internationalization
  • Friendly errors
  • Other (specify if possible)

p5.js version

2.2.3

Web browser and version

All

Operating system

All

Steps to reproduce this

Steps:

  1. Load an image
  2. Create a WebGL canvas
  3. Call noTint()
  4. Draw the image

It throws an error, can't access property "slice", data is null.

Snippet:

async function setup() {
  createCanvas(400, 400, WEBGL);
  img = await loadImage('https://upload.wikimedia.org/wikipedia/commons/thumb/c/c0/Bengal_tiger_in_Sanjay_Dubri_Tiger_Reserve_December_2024_by_Tisha_Mukherjee_15.jpg/1280px-Bengal_tiger_in_Sanjay_Dubri_Tiger_Reserve_December_2024_by_Tisha_Mukherjee_15.jpg')
  
  // Works when commented out
  noTint()
  imageMode(CENTER)
  image(img, 0, 0, width, height)
}

https://editor.p5js.org/davepagurek/sketches/aQs20UfMC

Metadata

Metadata

Assignees

Type

No type
No fields configured for issues without a type.

Projects

Status

Completed

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions