-
Notifications
You must be signed in to change notification settings - Fork 1.6k
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
Reduce palette - alpha only #819
Comments
This can reuse the current palette reducer, but before it's called, create a copy of the image and set all the RGBs to a single color. Then apply the alpha channel of the result back to the original image. |
Hi! Is this still in game? I'd like to pick it up if possible. |
Yeah absolutely! It should probably be added as a new option to the ImageQuant codec. If you wanted to take a stab at that, I’d be happy to review a draft PR. |
Agreed. An "alpha only" toggle on "Reduce palette". Implementation-wise, create a single-color version of the image with alpha preserved, pass it through imagequant, then apply the alpha of that result back to the input image. |
I'll make a draft PR as soon as possible, thank you for the hints, I'll keep those in sight. |
Hi! I was finally able to start working on it yesterday, but I'm having a tough time setting up the project. Based on the README it should be 3 easy steps right? (Sorry if I missed anything) I installed node modules without any trouble, but than the problems begun. I was using node version 18.14.2, and when I run
Okay no problem, after a little bit of searching I found this issue: #1204 Next step is npm run dev. I had some issues which I think is related to windows, because some commands here were not recognised couse I had this error message:
So I overwrote the command manually and ended up with this:
Watch runs fine, finds 0 errors, but hosting a dev server fails on multiple errors. dev would run this command:
Do you know anything about these errors? If you need any details please let me know. I'm sorry if anything of this is my bad, i'm new to github and this will be my very first open-source project contribution. Thanks in advance! |
You are right, it should be 3 simple steps. On Node 20.8 on a Mac, the following sequence works for me on a fresh clone:
So, definitely don’t downgrade Node. Node 18 is almost end-of-life, so I’d rather go the other way towards Node 20. Don’t use Are you using WSL? Because if not that might be the cause of these errors. I am not sure that we ever tried to make Squoosh dev server work in Powershell. |
Yes, you were absolutely right! Using WSL and node version 20.8 solved all the errors I mentioned above. Thank you for your help. |
Hi! @surma @jakearchibald |
WebP and JPEG-XL encode alpha data 'losslessly'. I'm not 100% sure with JPEG-XL, but WebP's compression benefits from palette reduction.
It'd be good to add a toggle to palette reduction that makes it only act on the alpha channel of the image.
The text was updated successfully, but these errors were encountered: