-
-
Notifications
You must be signed in to change notification settings - Fork 152
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
oxipng transform turns transparent-black part of PNG to transparent-white #704
Comments
Hi @chgi! Thanks for the bug report. Unfortunately, I'm getting the same (incorrect) result when running the Squoosh CLI manually: npm install --global @squoosh/cli
squoosh-cli --oxipng "{}" ~/Downloads/Demo/emit.png -d ~/Desktop/ glTF-Transform relies on the Node.js squoosh builds ( |
Hmm, I didn't think to test with the squoosh lib directly. I investigated a bit and it looks like squoosh is deliberately enabling the alpha optimization of oxipng here. Do you reckon, I should open a bug over at squoosh and ask them to at least expose the option to turn it off in the lib? |
I think it's worth filing the issue! They may not be aware that this makes a difference for WebGL, and perhaps other graphics-related use cases. Unfortunately it has been a while since the last squoosh updates were published. |
@donmccurdy , thanks for the heads-up! Just tried it with the attached file on Windows11, Node 18.12. The output file size is a bit larger than with the old version (as expected), but still smaller than the input. |
Thanks! To be fixed in v3 with #752. |
Describe the bug
I have a model with an attached PNG emissive texture.
For some reason, the texture has an alpha channel (I think it shouldn't be there, but we got it that way).
Using gltf-transform oxipng seems to turn all pixels that are transparent-black to transparent-white.
To Reproduce
Demo.glb
NODE_OPTIONS="--no-experimental-fetch" gltf-transform oxipng Demo.glb Demo_oxipng.glb
Expected behavior
The RGB values should not change. Black should stay black.
I realize that that the RGB value of a fully transparent pixel should not matter, but this behaviour breaks the lossless promise of PNG.
Versions:
Additional context
I tried to put the texture through oxipng standalone using https://squoosh.app/. The problem doesn't seem to occur there.
Before and after using
gltf-transform oxipng
Zip containing the source .blend file, the original texture and the glb before and after
Demo.zip
The text was updated successfully, but these errors were encountered: