[−][src]Function imagequant_sys::liq_set_quality
pub unsafe extern "C" fn liq_set_quality(
attr: &mut liq_attr,
minimum: c_int,
maximum: c_int
) -> liq_error
Quality is in range 0
(worst) to 100
(best) and values are analoguous to JPEG quality (i.e. 80
is usually good enough).
Quantization will attempt to use the lowest number of colors needed to achieve maximum
quality. maximum
value of 100
is the default and means conversion as good as possible.
If it's not possible to convert the image with at least minimum
quality (i.e. 256 colors is not enough to meet the minimum quality), then liq_image_quantize()
will fail. The default minumum is 0
(proceeds regardless of quality).
Quality measures how well the generated palette fits image given to liq_image_quantize()
. If a different image is remapped with liq_write_remapped_image()
then actual quality may be different.
Regardless of the quality settings the number of colors won't exceed the maximum (see liq_set_max_colors()
).
The first argument is attributes object from liq_attr_create()
.
Returns LIQ_VALUE_OUT_OF_RANGE
if target is lower than minimum or any of them is outside the 0-100 range.
Returns LIQ_INVALID_POINTER
if attr
appears to be invalid.