Skip to content

Background image with alpha not working as expected #5175

@paulcanning

Description

@paulcanning

Using the following simply code, the alpha parameter simply has no effect

function setup() {
    ...
    bg = loadImage('bg.jpg');
    ...
}

function draw() {
    ...
    background(bg, 10);
    ...
}

If you replace bg in background() 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 using background() and the documentation even states you can use an image and an alpha value.

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