mirror of
https://github.com/GoogleChromeLabs/squoosh.git
synced 2025-11-14 09:39:15 +00:00
Actually respect numColors lol
This commit is contained in:
@@ -30,7 +30,7 @@ void quantize(uint8_t* image_buffer, int image_width, int image_height, int num_
|
|||||||
int size = image_width * image_height;
|
int size = image_width * image_height;
|
||||||
attr = liq_attr_create();
|
attr = liq_attr_create();
|
||||||
image = liq_image_create_rgba(attr, image_buffer, image_width, image_height, 0);
|
image = liq_image_create_rgba(attr, image_buffer, image_width, image_height, 0);
|
||||||
liq_set_max_colors(attr, 16);
|
liq_set_max_colors(attr, num_colors);
|
||||||
liq_image_quantize(image, attr, &res);
|
liq_image_quantize(image, attr, &res);
|
||||||
liq_set_dithering_level(res, dithering);
|
liq_set_dithering_level(res, dithering);
|
||||||
uint8_t* image8bit = (uint8_t*) malloc(size);
|
uint8_t* image8bit = (uint8_t*) malloc(size);
|
||||||
|
|||||||
Binary file not shown.
Reference in New Issue
Block a user