Feature Request: Add -sharp_yuv Command Line Option for Improved GIF to WEBP Conversion

38 views
Skip to first unread message

Tim Janik

unread,
Oct 23, 2024, 11:09:23 PMOct 23
to webp-d...@webmproject.org
Dear libwebp team,

I am currently using gif2webp from libwebp7 1.3.2-0.4build3 in Ubuntu 24.04.

When converting screencasts with lossy compression, the colors look washed-out.

I am writing to request the addition of a -sharp_yuv command line option for
the gif2webp example, to bring it in line with other tools such as cwebp.

I tested conversion with the following diff applied:

diff -u examples/gif2webp.c.orig examples/gif2webp.c
--- examples/gif2webp.c.orig 2024-10-24 02:23:51.629942619 +0200
+++ examples/gif2webp.c 2024-10-24 02:24:01.456995741 +0200
@@ -143,6 +143,7 @@
FREE_WARGV_AND_RETURN(-1);
}
config.lossless = 1; // Use lossless compression by default.
+ config.use_sharp_yuv = 1;

WebPDataInit(&webp_data);
WebPDataInit(&icc_data);


Adding this flag is enough to fix the issue, but since the output
size increases, making it optional behind -sharp_yuv would be
preferred.

Thanks for consideration.


--
https://testbit.eu/timj
Free software author.

James Zern

unread,
Nov 4, 2024, 2:23:07 PMNov 4
to webp-d...@webmproject.org
Hi,

On Wed, Oct 23, 2024 at 8:09 PM Tim Janik <ti...@gnu.org> wrote:
Dear libwebp team,

I am currently using gif2webp from libwebp7 1.3.2-0.4build3 in Ubuntu 24.04.

When converting screencasts with lossy compression, the colors look washed-out.

I am writing to request the addition of a -sharp_yuv command line option for
the gif2webp example, to bring it in line with other tools such as cwebp.

Thanks for raising the issue. `img2webp` had this option added some time ago (v1.3.1), but `gif2webp` was missed. I'll add this before the next release.

James Zern

unread,
Nov 4, 2024, 4:54:13 PMNov 4
to webp-d...@webmproject.org
On Mon, Nov 4, 2024 at 11:22 AM James Zern <jz...@google.com> wrote:
Hi,

On Wed, Oct 23, 2024 at 8:09 PM Tim Janik <ti...@gnu.org> wrote:
Dear libwebp team,

I am currently using gif2webp from libwebp7 1.3.2-0.4build3 in Ubuntu 24.04.

When converting screencasts with lossy compression, the colors look washed-out.

I am writing to request the addition of a -sharp_yuv command line option for
the gif2webp example, to bring it in line with other tools such as cwebp.

Thanks for raising the issue. `img2webp` had this option added some time ago (v1.3.1), but `gif2webp` was missed. I'll add this before the next release.

James Zern

unread,
Nov 6, 2024, 10:29:09 PMNov 6
to webp-d...@webmproject.org
On Mon, Nov 4, 2024 at 1:53 PM James Zern <jz...@google.com> wrote:


On Mon, Nov 4, 2024 at 11:22 AM James Zern <jz...@google.com> wrote:
Hi,

On Wed, Oct 23, 2024 at 8:09 PM Tim Janik <ti...@gnu.org> wrote:
Dear libwebp team,

I am currently using gif2webp from libwebp7 1.3.2-0.4build3 in Ubuntu 24.04.

When converting screencasts with lossy compression, the colors look washed-out.

I am writing to request the addition of a -sharp_yuv command line option for
the gif2webp example, to bring it in line with other tools such as cwebp.

Thanks for raising the issue. `img2webp` had this option added some time ago (v1.3.1), but `gif2webp` was missed. I'll add this before the next release.


This has landed and will be included in the 1.5.0 release which should happen before the end of the year or in early Q1 2025. Thanks again for pointing this out.
Reply all
Reply to author
Forward
0 new messages