Files
squoosh/codecs/mozjpeg_enc
Jake Archibald 8006a1a5e7 Memory view rather than pointers (#144). Part of #141.
* Returning an object seems to work well

* This doesn't work

* This does!

* Better cast?

* Updating usage in Squoosh
2018-08-21 09:27:04 +01:00
..
2018-08-17 16:25:28 +01:00

MozJPEG encoder

Dependencies

  • Docker
  • Automake
  • pkg-config

Example

See example.html

API

int version()

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

void free_result()

Frees the result created by encode().

Uint8Array encode(std::string image_in, int image_width, int image_height, MozJpegOptions opts)

Encodes the given image with given dimension to JPEG. Options looks like this:

struct MozJpegOptions {
  int quality;
  bool baseline;
  bool arithmetic;
  bool progressive;
  bool optimize_coding;
  int smoothing;
  int color_space;
  int quant_table;
  bool trellis_multipass;
  bool trellis_opt_zero;
  bool trellis_opt_table;
  int trellis_loops;
};