mirror of
https://github.com/ddidderr/wuffs.git
synced 2026-11-26 17:01:35 +01:00
lib/lowleveljpeg: add MinimumBaselineQuality
This commit is contained in:
1 parent
0c7f1a4a1f
commit
64daf2653e
1 file changed
+19
@@ -68,6 +68,25 @@ const (
|
|||||||
// SetToStandardValues' quality parameter. It matches libjpeg's default
|
// SetToStandardValues' quality parameter. It matches libjpeg's default
|
||||||
// both in terms of numerical value and in behavior.
|
// both in terms of numerical value and in behavior.
|
||||||
DefaultQuality = 75
|
DefaultQuality = 75
|
||||||
|
|
||||||
|
// MinimumBaselineQuality is lowest quality level where both the cjpeg
|
||||||
|
// program (from the libjpeg C project) and this Go package will agree on
|
||||||
|
// the exact quantization factors.
|
||||||
|
//
|
||||||
|
// It's still valid to pass a SetToStandardValues quality parameter value
|
||||||
|
// below 24. But when doing so, passing the equivalent to cjpeg will print
|
||||||
|
// a JTRC_16BIT_TABLES warning: "quantization tables are too coarse for
|
||||||
|
// baseline JPEG". cjpeg will therefore produce extended (instead of
|
||||||
|
// baseline) JPEGs, using 2 bytes (instead of 1 byte) per quantization
|
||||||
|
// factor, allowing factors above 0xFF.
|
||||||
|
//
|
||||||
|
// This Go package will instead clamp such quantization factors to 0xFF.
|
||||||
|
//
|
||||||
|
// Both approaches are viable, producing valid JPEGs. This Go package, like
|
||||||
|
// the Go standard library's image/jpeg package, simply chooses to always
|
||||||
|
// produce baseline (instead of extended) JPEGs, for best compatibility
|
||||||
|
// with other JPEG decoders.
|
||||||
|
MinimumBaselineQuality = 24
|
||||||
)
|
)
|
||||||
|
|
||||||
// SetToStandardValues sets b to one of two standard quantization tables
|
// SetToStandardValues sets b to one of two standard quantization tables
|
||||||
|
|||||||
Reference in new issue
Block a user