Files
squoosh/codecs/imagequant
Jake Archibald ef4094885e Easter egg (#123)
* lol zx quant

* Adding ZX option

* Improving colour selection so we don't end up with the same colour twice. Also fixing a bug with the colour conflict resolution.

* Putting it behind a konami code

* Better comments

* Adding comment

* Removing unnecessary malloc.
2018-08-06 12:42:23 +01:00
..
2018-08-06 12:42:23 +01:00
2018-08-06 12:42:23 +01:00
2018-07-30 15:51:57 +01:00
2018-08-06 12:42:23 +01:00
2018-08-06 12:42:23 +01:00
2018-08-06 12:42:23 +01:00
2018-07-30 15:51:57 +01:00
2018-07-30 15:51:57 +01:00

ImageQuant

Dependencies

  • Docker

Example

See example.html

API

int version()

Returns the version of libimagequant as a number. va.b.c is encoded as 0x0a0b0c

uint8_t* create_buffer(int width, int height)

Allocates an RGBA buffer for an image with the given dimension.

void destroy_buffer(uint8_t* p)

Frees a buffer created with create_buffer.

void quantize(uint8_t* image_buffer, int image_width, int image_height, int numColors, float dithering)

Quantizes the given images, using at most numColors, a value between 2 and 256. dithering is a value between 0 and 1 controlling the amount of dithering.

void free_result()

Frees the result created by encode().

int get_result_pointer()

Returns the pointer to the start of the buffer holding the encoded data. It has the same size as the input image buffer.