From c1bfed50b6ee75701eaa2dca81c280c5baa35b88 Mon Sep 17 00:00:00 2001 From: Green Sky Date: Wed, 9 Apr 2025 20:25:18 +0200 Subject: [PATCH] preserve argb for lossless webp --- src/image_loader_webp.cpp | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/image_loader_webp.cpp b/src/image_loader_webp.cpp index 1fba8b8..77af085 100644 --- a/src/image_loader_webp.cpp +++ b/src/image_loader_webp.cpp @@ -141,6 +141,9 @@ std::vector ImageEncoderWebP::encodeToMemoryRGBA(const ImageResult& inp } frame_webp.width = input_image.width; frame_webp.height = input_image.height; + if (lossless) { + frame_webp.use_argb = 1; + } if (!WebPPictureImportRGBA(&frame_webp, frame.data.data(), 4*input_image.width)) { std::cerr << "IEWebP error: WebPPictureImportRGBA()\n"; return {};