noSmooth() does nothing on images loaded via preload
Open
Nobody has claimed this yet.
Area:Core
Area:Image
Bug
- Dominant language
- JavaScript
- Stars
- 24k
- Forks
- 3.8k
- Avg merge
- 3d 16h
- Merged PRs (30d)
- 25
Description
Most appropriate sub-area of p5.js?
- Accessibility (Web Accessibility)
- Build tools and processes
- Color
- Core/Environment/Rendering
- Data
- DOM
- Events
- Friendly error system
- Image
- IO (Input/Output)
- Localization
- Math
- Unit Testing
- Typography
- Utilities
- WebGL
- Other (specify if possible)
Details about the bug:
- p5.js version: 1.4.0
- Web browser and version: Firefox 95 Build ID: 20211129150630
- Operating System: Ubuntu 20.10
- Steps to reproduce this:
Use the following code in either the web editor or the p5 example project.
function preload() {
pixelArt = loadImage("pixelArt.png");
}
function setup() {
createCanvas(400, 400);
noSmooth();
pixelArt.resize(150, 0);
}
function draw() {
image(pixelArt, 0, 0);
}
noSmooth() does not function as intended, however upon moving the image definition from preload to setup, the image now resizes properly with no aliasing.
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start with the provided reproduction in the web editor, then trace the noSmooth(), loadImage(), resize(), and image() paths for images loaded during preload(). Done means the same no-aliasing behavior works when the image is loaded in preload() as when it is loaded in setup().
Written by the indexing model from the issue text.
Assessment
- Tech stack
- javascript
- Domain
- computer-graphics
- Issue type
- Bug
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 45/100