Files
squoosh/codecs/mozjpeg_enc
Jake Archibald 7346511fa1 Merge v2 codecs (#844)
* wip

* doh, whitespace

* Updating emscripten, restoring export name

* Updating oxipng

* Build wasm

* Fix oxipng; upgrade Rust

* More v2-codec integration

* AVIF now working

* Non-working JXL

* Build hqx with Rust 1.40; refactor build-rust*.sh

* Set web target

* wp2 wip

* wp2 decode options

* Better logo height when loading the logo into squoosh

* Build oxi

* JAKE IS AN IDIOT

* wip oxipng

* Fixing case sensitive imports

* adding log

* another log

* Abort tasks when compress component removed

* Adding progressive option to JXL

* Fix bug going to & from original image

* Exposing epf in jxl

* logs

* Bypass initial CSS plugin

* Revert "logs"

* Adding root

* Fix for finding TSC on Windows

* Use spawn again

* Converting to module paths

* Remove spawnP

* silly

* oops

* logs

* Fixing glob paths in CSS plugin

* Path normalising

* Normalise paths for CSS plugin

* Normalise again

* Use correct func

* Adding lossless mode and near lossless (but hidden in UI)

* Removing useless comments

* Some logging

* Update JXL to v0.1. (#846)

* Rebuild JXL

* Adding slight loss option

Co-authored-by: Ingvar Stepanyan <rreverser@google.com>
Co-authored-by: Luca Versari <veluca93@gmail.com>
2020-11-19 10:55:43 +00:00
..
wip
2020-09-16 10:08:50 +01:00
2020-08-21 13:44:36 +01:00
wip
2020-09-16 10:08:50 +01:00
2020-07-28 16:35:00 +01:00
2020-11-19 10:55:43 +00:00
2020-11-19 10:55:43 +00:00
2020-07-30 13:28:41 +01:00
2020-07-30 13:28:41 +01:00
2020-08-21 13:44:36 +01:00

MozJPEG encoder

Dependencies

  • Docker

Example

See example.html

API

int version()

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

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;
  bool auto_subsample;
  int chroma_subsample;
  bool separate_chroma_quality;
  int chroma_quality;
};