-
-
Notifications
You must be signed in to change notification settings - Fork 3.5k
Background image with alpha not working as expected #5175
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Comments
So, either the documentation is incorrect, or its correct and someone forgot to write this feature properly p5.js/src/core/p5.Renderer2D.js Lines 49 to 51 in 374acfb
The alpha argument is simply disregarded when loading an image. 🤦 |
I tried the same and read the documentation, it mentions |
I guess the easy fix would be just using tint() before using image(). |
@two-ticks great, I will assign you |
Can I work on this issue , if no one is working on it. I would love to work on this issue . |
@Palaksharma23 this was already assigned to someone if you look at the activity log |
Hi @Palaksharma23! I am working on this issue in PR #5225. I have fixed the problem partially (not optimized), it would be great if you can fix the issue. If you have any improvements or want it to be reassigned to you, you can ask maintainers on the PR (#5225). |
Using the following simply code, the alpha parameter simply has no effect
If you replace
bg
inbackground()
with a colour value, you see trails on screen, which is correct, but with the image, there are no trails, effectively, the alpha value doesn't work. You can test this by changing the alpha value to anything and there is no difference. I tried ranges 0-1, and 0-255.NB - this issue, #1906, was closed, with @limzykenneth stating
background()
could not accept an image, which is false, proven by the fact you can indeed load an image usingbackground()
and the documentation even states you can use an image and an alpha value.The text was updated successfully, but these errors were encountered: