We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
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
Steps to Reproduce:
The current implementation of RenderTexture has several issues.
Firstly, it does not set the premultiplied alpha flag on the image created by this method:
Image* RenderTexture::newImage(bool flipImage) { ... image->initWithRawData(buffer, savedBufferWidth * savedBufferHeight * 4, savedBufferWidth, savedBufferHeight, 8); } else { image->initWithRawData(tempData, savedBufferWidth * savedBufferHeight * 4, savedBufferWidth, savedBufferHeight, 8); } ... }
The correct code would be to change the initWithRawData calls to this:
image->initWithRawData(buffer, savedBufferWidth * savedBufferHeight * 4, savedBufferWidth, savedBufferHeight, 8, true); } else { image->initWithRawData(tempData, savedBufferWidth * savedBufferHeight * 4, savedBufferWidth, savedBufferHeight, 8, true);
Secondly, there is no way to choose if you want to save the file as a non-premultiplied alpha PNG.
Reversing the PMA before saving the image is possible, and a new method can be added to do this, such as: RenderTexture::saveToFileAsNonPMA().
I'll create a pull request with the changes, along with modification of the tests to cater for this new method.
This fix may work for the following reported issues: #18980 #18193
The text was updated successfully, but these errors were encountered:
No branches or pull requests
Steps to Reproduce:
The current implementation of RenderTexture has several issues.
Firstly, it does not set the premultiplied alpha flag on the image created by this method:
The correct code would be to change the initWithRawData calls to this:
Secondly, there is no way to choose if you want to save the file as a non-premultiplied alpha PNG.
Reversing the PMA before saving the image is possible, and a new method can be added to do this, such as: RenderTexture::saveToFileAsNonPMA().
I'll create a pull request with the changes, along with modification of the tests to cater for this new method.
This fix may work for the following reported issues:
#18980
#18193
The text was updated successfully, but these errors were encountered: