Skip to content

Commit

Permalink
enable near-lossless compression quality (ImageMagick/ImageMagick#6204)
Browse files Browse the repository at this point in the history
  • Loading branch information
Cristy committed Mar 29, 2023
1 parent b76a842 commit a0bd172
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions coders/webp.c
Original file line number Diff line number Diff line change
Expand Up @@ -1142,7 +1142,9 @@ static MagickBooleanType WriteWEBPImage(const ImageInfo *image_info,
if (WebPConfigInit(&configure) == 0)
ThrowWriterException(ResourceLimitError,"UnableToEncodeImageFile");
if (image->quality != UndefinedCompressionQuality)
configure.quality=(float) image->quality;
#if WEBP_ENCODER_ABI_VERSION >= 0x020e
configure.near_lossless=(float) image->quality;
#endif
if (image->quality >= 100)
configure.lossless=1;
SetBooleanOption(image_info,"webp:lossless",&configure.lossless);
Expand Down Expand Up @@ -1196,7 +1198,6 @@ static MagickBooleanType WriteWEBPImage(const ImageInfo *image_info,
SetBooleanOption(image_info,"webp:exact",&configure.exact);
#endif
#if WEBP_ENCODER_ABI_VERSION >= 0x020e
SetIntegerOption(image_info,"webp:near-lossless",&configure.near_lossless);
SetBooleanOption(image_info,"webp:use-sharp-yuv",&configure.use_sharp_yuv);
#endif
if (((configure.target_size > 0) || (configure.target_PSNR > 0)) &&
Expand Down

0 comments on commit a0bd172

Please sign in to comment.