Skip to content
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

fillRect not working on transparent Image #618

Open
Equirinya opened this issue Feb 26, 2024 · 2 comments
Open

fillRect not working on transparent Image #618

Equirinya opened this issue Feb 26, 2024 · 2 comments

Comments

@Equirinya
Copy link

When creating a transparent image filling it with a rounded Rect does not seem to work:

img.Image bgImage = img.Image(width: 512, height:512, numChannels: 4);

bgImage = img.fillRect(bgImage, x1: 0, y1: 0, x2: bgImage.width, y2: bgImage.height, 
                              color: img.ColorRgba8(13, 42, 62, 255), radius: 20, maskChannel: img.Channel.alpha);

// => bgImage still just transparent

whereas just filling it with a color works:
bgImage = img.fill(bgImage, color: img.ColorRgba8(13, 42, 62, 255), maskChannel: img.Channel.alpha);

@Equirinya
Copy link
Author

Ive tested it a bit more and it actually appears to fill in a transparent rect no matter the color or maskChannel

@brendan-duncan
Copy link
Owner

Perhaps the masking logic needs to be reworked to be able to do channel based masking without a mask image. Currently you have to provide a mask image, and maskChannel indicates which channel of the mask image to use.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants