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

Could libimagequant be extended to more than 256 colours? #105

Open
cmeister2 opened this issue Apr 10, 2023 · 1 comment
Open

Could libimagequant be extended to more than 256 colours? #105

cmeister2 opened this issue Apr 10, 2023 · 1 comment

Comments

@cmeister2
Copy link

My use case is that I want to map images into the DMC Colour Chart, which has a palette of around 447 colours in it. Most programs are designed to map into a colour space of 256 colours or less; currently libimagequant appears to be one of those. My question is whether there's an easy path to being able to define a larger colour space without raising errors.

@kornelski
Copy link
Member

kornelski commented Apr 10, 2023

It can work, but you need to modify the source:

libimagequant/src/pal.rs

Lines 200 to 207 in dc3e6d1

#[cfg(feature = "large_palettes")]
pub type PalIndex = u16;
#[cfg(not(feature = "large_palettes"))]
pub type PalIndex = u8;
/// This could be increased to support > 256 colors in remapping too
pub type PalIndexRemap = u8;

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