Re: libwebp and YUV sharpness

Shane Bishop <[email protected]> Tue, 6 Apr 2021 09:44:54 -0600
Newsgroups gmane.comp.video.graphicsmagick.help
Message-ID <CAOSZYLiHojamSvSsmOEr=Cdd6MUBMdVnzTJJEGRzgae7svTy-A@mail.gmail.com>
--===============7401881645985737566==
Content-Type: multipart/alternative; boundary="0000000000000403ef05bf4fb3e5"

--0000000000000403ef05bf4fb3e5
Content-Type: text/plain; charset="UTF-8"

On Fri, Apr 2, 2021 at 4:57 PM Bob Friesenhahn <[email protected]>
wrote:

> On Fri, 2 Apr 2021, Shane Bishop wrote:
>
> > Hi folks,
> > We use the gmagick extension (2.0.5rc1/1.3.35) for PHP (7.3) to produce
> > WebP images for our client sites, and we're wondering if there is a way
> to
> > pass the use_sharp_yuv to libwebp (1.2.0) via gmagick?
> > We have a particular client who has done some testing with cwebp and the
> > -sharp-yuv option and they are pleased with the results, but gmagick is
> > currently yielding "softer" results than they like.
> > Any ideas on this?
>
> GraphicsMagick supports a bunch of WebP defines.  There is a define
> called 'webp:use-sharp-yuv' which may be set to the values 'true' or
> 'false'.  Hopefully the gmagick extension supports passing 'define'
> options for the reader and writer.
>

Alright, I'll look into that then, and see if gmagick supports such things,
thanks for the tip!

>
> > Also, somewhat related, I'm noticing that gmagick.so seems to be linked
> to
> > both libwebp.so.6 (system-installed) and libwebp.so.7 (version 1.2.0 that
> > we install from source). Does gmagick automatically use the newer one if
> > available? Or how do we know which one is in use?
>
> That does not sound good.  If using Linux, one can enable run-time
> linker debugging via the LD_DEBUG environment variable and then run
> your program.  Debug output should appear on the terminal.  This is
> documented in the ld.so manual page.  For example, you could specify
> 'LD_DEBUG=symbols' or 'LD_DEBUG=libs'.  This is way to know the
> symbols used and the
> libraries searched.
>

I ran php with both options, and I'll admit I don't know exactly what
everything there means. But as best I can tell, it searches for both
libwebp.so.6 and libwebp.so.7, in that order.
Then at the end, it calls libwebp.so.7 first, and then a few lines later it
calls libwebp.so.6, like so (shortened for brevity):
      6981: calling fini: /usr/local/lib/libwebp.so.7 [0] <-- this is from
version 1.2.0
      6981: calling fini: /usr/lib/php/20180731/gettext.so [0]
      6981: calling fini: /usr/lib/php/20180731/gd.so [0]
      6981: calling fini: /lib/x86_64-linux-gnu/libgd.so.3 [0]
      6981: calling fini: /lib/x86_64-linux-gnu/libXpm.so.4 [0]
      6981: calling fini: /lib/x86_64-linux-gnu/libX11.so.6 [0]
      6981: calling fini: /lib/x86_64-linux-gnu/libfontconfig.so.1 [0]
      6981: calling fini: /lib/x86_64-linux-gnu/libfreetype.so.6 [0]
      6981: calling fini: /lib/x86_64-linux-gnu/libpng16.so.16 [0]
      6981: calling fini: /lib/x86_64-linux-gnu/libtiff.so.5 [0]
      6981: calling fini: /lib/x86_64-linux-gnu/libwebp.so.6 [0] <-- this
is from version .6.1

--0000000000000403ef05bf4fb3e5
Content-Type: text/html; charset="UTF-8"
Content-Transfer-Encoding: quoted-printable

<div dir=3D"ltr"><div dir=3D"ltr">On Fri, Apr 2, 2021 at 4:57 PM Bob Friese=
nhahn &lt;<a href=3D"mailto:[email protected]">[email protected]=
allas.tx.us</a>&gt; wrote:<br></div><div class=3D"gmail_quote"><blockquote =
class=3D"gmail_quote" style=3D"margin:0px 0px 0px 0.8ex;border-left:1px sol=
id rgb(204,204,204);padding-left:1ex">On Fri, 2 Apr 2021, Shane Bishop wrot=
e:<br>
<br>
&gt; Hi folks,<br>
&gt; We use the gmagick extension (2.0.5rc1/1.3.35) for PHP (7.3) to produc=
e<br>
&gt; WebP images for our client sites, and we&#39;re wondering if there is =
a way to<br>
&gt; pass the use_sharp_yuv to libwebp (1.2.0) via gmagick?<br>
&gt; We have a particular client who has done some testing with cwebp and t=
he<br>
&gt; -sharp-yuv option and they are pleased with the results, but gmagick i=
s<br>
&gt; currently yielding &quot;softer&quot; results than they like.<br>
&gt; Any ideas on this?<br>
<br>
GraphicsMagick supports a bunch of WebP defines.=C2=A0 There is a define <b=
r>
called &#39;webp:use-sharp-yuv&#39; which may be set to the values &#39;tru=
e&#39; or <br>
&#39;false&#39;.=C2=A0 Hopefully the gmagick extension supports passing &#3=
9;define&#39; <br>
options for the reader and writer.<br></blockquote><div><br></div><div>Alri=
ght, I&#39;ll look into that then, and see if gmagick supports such things,=
 thanks for the tip!=C2=A0</div><blockquote class=3D"gmail_quote" style=3D"=
margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-lef=
t:1ex">
<br>
&gt; Also, somewhat related, I&#39;m noticing that gmagick.so seems to be l=
inked to<br>
&gt; both libwebp.so.6 (system-installed) and libwebp.so.7 (version 1.2.0 t=
hat<br>
&gt; we install from source). Does gmagick automatically use the newer one =
if<br>
&gt; available? Or how do we know which one is in use?<br>
<br>
That does not sound good.=C2=A0 If using Linux, one can enable run-time <br=
>
linker debugging via the LD_DEBUG environment variable and then run <br>
your program.=C2=A0 Debug output should appear on the terminal.=C2=A0 This =
is <br>
documented in the ld.so manual page.=C2=A0 For example, you could specify <=
br>
&#39;LD_DEBUG=3Dsymbols&#39; or &#39;LD_DEBUG=3Dlibs&#39;.=C2=A0 This is wa=
y to know the <br>
symbols used and the <br>
libraries searched.<br></blockquote><div><br></div><div>I ran php with both=
 options, and I&#39;ll admit I don&#39;t know exactly what everything there=
 means. But as best I can tell, it searches for both libwebp.so.6 and libwe=
bp.so.7, in that order.</div><div>Then at the end, it calls libwebp.so.7 fi=
rst, and then a few lines later it calls libwebp.so.6, like so (shortened f=
or brevity):</div><div>=C2=A0 =C2=A0 =C2=A0 6981:	calling fini: /usr/local/=
lib/libwebp.so.7 [0] &lt;-- this is from version 1.2.0<br>=C2=A0 =C2=A0 =C2=
=A0 6981:	calling fini: /usr/lib/php/20180731/gettext.so [0]<br>=C2=A0 =C2=
=A0 =C2=A0 6981:	calling fini: /usr/lib/php/20180731/gd.so [0]<br>=C2=A0 =
=C2=A0 =C2=A0 6981:	calling fini: /lib/x86_64-linux-gnu/libgd.so.3 [0]<br>=
=C2=A0 =C2=A0 =C2=A0 6981:	calling fini: /lib/x86_64-linux-gnu/libXpm.so.4 =
[0]<br>=C2=A0 =C2=A0 =C2=A0 6981:	calling fini: /lib/x86_64-linux-gnu/libX1=
1.so.6 [0]<br>=C2=A0 =C2=A0 =C2=A0 6981:	calling fini: /lib/x86_64-linux-gn=
u/libfontconfig.so.1 [0]<br>=C2=A0 =C2=A0 =C2=A0 6981:	calling fini: /lib/x=
86_64-linux-gnu/libfreetype.so.6 [0]<br>=C2=A0 =C2=A0 =C2=A0 6981:	calling =
fini: /lib/x86_64-linux-gnu/libpng16.so.16 [0]<br>=C2=A0 =C2=A0 =C2=A0 6981=
:	calling fini: /lib/x86_64-linux-gnu/libtiff.so.5 [0]<br>=C2=A0 =C2=A0 =C2=
=A0 6981:	calling fini: /lib/x86_64-linux-gnu/libwebp.so.6 [0] &lt;-- this =
is from version .6.1<br></div><div><br></div></div></div>

--0000000000000403ef05bf4fb3e5--


--===============7401881645985737566==
Content-Type: text/plain; charset="us-ascii"
MIME-Version: 1.0
Content-Transfer-Encoding: 7bit
Content-Disposition: inline


--===============7401881645985737566==
Content-Type: text/plain; charset="us-ascii"
MIME-Version: 1.0
Content-Transfer-Encoding: 7bit
Content-Disposition: inline

_______________________________________________
Graphicsmagick-help mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/graphicsmagick-help

--===============7401881645985737566==--