-
-
Notifications
You must be signed in to change notification settings - Fork 677
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
WIP -- add vips_palette #3122
base: master
Are you sure you want to change the base?
WIP -- add vips_palette #3122
Conversation
It looks like I've hit a blocker: putting a palette into VipsQuantiseResult using vips__quantise_image_quantize_fixed() seems to renumber the palette. I think we need a supported way to set the palette that we want vips__quantise_write_remapped_image() to use. |
To show the problem, try this:
To make: You can see the index has become scrambled. Index 0 of the palette is:
But that RGBA appears in the palette built by vips__quantise_image_quantize_fixed() as:
Index 53. |
@jcupitt is this totally discarded? This feature would be awesome to extract most used/dominant colors. |
It's not discarded, just snoozing :) Maybe I'll find time to work on it again later this year. Or someone else could pick it up, of course. |
@jcupitt could it be possible to add a parameter to specify the number of colors for the palette? |
@infacto yes, though it's blocked on the remapper not supporting a generated palette, unfortunately. This needs a small change to an upstream project. |
See #3010 and #2841
So far this is just a simple wrapper around the quantiser.
To do
pngload
attach the load palette? tiff could toogif-palette
and get that to set plainpalette
as well