MozJPEG chroma subsampling and quality (#235)

* Adding chroma subsampling for mozjpeg

* Adding separate chroma quality.

* Preact sometimes removes the inline styles, this fixes it.

* Simplifying chroma subsample

* Adding comments
This commit is contained in:
Jake Archibald
2018-11-06 13:46:52 +00:00
committed by GitHub
parent e572b853e2
commit f396a5b784
8 changed files with 114 additions and 20 deletions

View File

@@ -17,6 +17,10 @@ export interface EncodeOptions {
trellis_opt_zero: boolean;
trellis_opt_table: boolean;
trellis_loops: number;
auto_subsample: boolean;
chroma_subsample: number;
separate_chroma_quality: boolean;
chroma_quality: number;
}
export interface EncoderState { type: typeof type; options: EncodeOptions; }
@@ -38,4 +42,8 @@ export const defaultOptions: EncodeOptions = {
trellis_opt_zero: false,
trellis_opt_table: false,
trellis_loops: 1,
auto_subsample: true,
chroma_subsample: 2,
separate_chroma_quality: false,
chroma_quality: 75,
};