You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@guacamole.apache.org by Andras Sali <sa...@gmail.com> on 2020/08/06 12:57:30 UTC

WebP Lossless instead of PNG?

Hi,

Has the use of a lossless version of WebP encoding been investigated
instead of PNG?

According to the below benchmark (not sure how up-to-date), with a fairly
low compression setting (q=0, m=1) webp still needs on average less bytes /
pixel than PNG reference (Table 1), whilst being x2 faster for encoding
(Table 2):

https://developers.google.com/speed/webp/docs/webp_lossless_alpha_study

In general Guacamole performance is quite good, but when starting to scroll
it can lag substantially more than a direct RDP connection (even if the RDP
server is on the same host as guacamole server) - before the lossy WebP
kicks in. I would be curious if trying to use WebP consistently (also for
lossless, not just for high-framerate lossy setup) might improve somewhat
the responsiveness.

Has anyone investigated this, or does this sound like a bad idea?

Many thanks,

András

ps: apologies if this message appears twice, I sent one originally before
subscribing to the list and I am unsure if that went through.

Re: WebP Lossless instead of PNG?

Posted by Andras Sali <sa...@gmail.com>.
In case someone follows this mailing list but not the github repository, I
have experimented with WebP lossless and seem to be getting good results
(our use-case is when the latency between gateway and remote desktop server
is low and bottleneck appears to be compression speed of PNG).

If there are interested parties in trying the modified configuration, there
is a simple (non-production, testing only) setup that can be tried in this
PR:

https://github.com/apache/guacamole-server/pull/322

Would be happy to get feedback how it works for others as well.


András


On Fri, Aug 7, 2020 at 6:01 PM Andras Sali <sa...@gmail.com> wrote:

> Many thanks for this insight Mike!
>
> Best,
>
> András
>
>
> On Fri, Aug 7, 2020 at 5:26 PM Mike Jumper <mj...@apache.org> wrote:
>
>> On Fri, Aug 7, 2020, 06:30 Andras Sali <sa...@gmail.com> wrote:
>>
>> > Hi Nick,
>> >
>> > Yes, thanks, I am aware that guacd already can use WebP if it's
>> available.
>> > However if I see correctly, it is only used for **lossy compression** -
>> the
>> > lossless flag is set to 0 (
>> >
>> >
>> https://github.com/apache/guacamole-server/blob/master/src/common/surface.c#L1794
>> > ).
>> >
>> > WebP also supports lossless compression using a separate algorithm (
>> >
>> >
>> https://developers.google.com/speed/webp/docs/webp_lossless_bitstream_specification
>> > ),
>> > which would be a direct alternative for PNG updates. In the benchmark I
>> > linked in my previous email, lossless webP encoding can be faster and
>> more
>> > efficient for many types of images than PNG (question if this is also
>> the
>> > case for screen updates).
>> >
>> > So I understand that guacd already intelligently switches between PNG /
>> > WebP Lossy depending on different metrics, however my question is
>> regarding
>> > using WebP Lossless instead of PNG. In this case the switching would be
>> > between WebP Lossless and / WebP Lossy depending on the metrics.
>> >
>> > Has this already been tried and discarded for some reason?
>> >
>>
>> Yes, waaayyy back when WebP support was first finding its way into
>> Guacamole, prior to the project moving to the ASF. There were mixed
>> results
>> in our own testing, showing that WebP would often compress worse and
>> slower
>> than PNG, resulting in increased latency and bandwidth usage.
>>
>> There was also a mysterious issue where libwebp would effectively ignore
>> the lossless quality setting and produce lossy images. By now, this may no
>> longer be a problem, however I suspect the negative performance
>> characteristics relative to PNG will still be there.
>>
>> If you would like to give it a try, by all means see whether things do
>> improve, however the answer to your question is "yes, lossless WebP was
>> investigated and ultimately rejected due to poor performance
>> characteristics compared to PNG."
>>
>> - Mike
>>
>

Re: WebP Lossless instead of PNG?

Posted by Andras Sali <sa...@gmail.com>.
Many thanks for this insight Mike!

Best,

András


On Fri, Aug 7, 2020 at 5:26 PM Mike Jumper <mj...@apache.org> wrote:

> On Fri, Aug 7, 2020, 06:30 Andras Sali <sa...@gmail.com> wrote:
>
> > Hi Nick,
> >
> > Yes, thanks, I am aware that guacd already can use WebP if it's
> available.
> > However if I see correctly, it is only used for **lossy compression** -
> the
> > lossless flag is set to 0 (
> >
> >
> https://github.com/apache/guacamole-server/blob/master/src/common/surface.c#L1794
> > ).
> >
> > WebP also supports lossless compression using a separate algorithm (
> >
> >
> https://developers.google.com/speed/webp/docs/webp_lossless_bitstream_specification
> > ),
> > which would be a direct alternative for PNG updates. In the benchmark I
> > linked in my previous email, lossless webP encoding can be faster and
> more
> > efficient for many types of images than PNG (question if this is also the
> > case for screen updates).
> >
> > So I understand that guacd already intelligently switches between PNG /
> > WebP Lossy depending on different metrics, however my question is
> regarding
> > using WebP Lossless instead of PNG. In this case the switching would be
> > between WebP Lossless and / WebP Lossy depending on the metrics.
> >
> > Has this already been tried and discarded for some reason?
> >
>
> Yes, waaayyy back when WebP support was first finding its way into
> Guacamole, prior to the project moving to the ASF. There were mixed results
> in our own testing, showing that WebP would often compress worse and slower
> than PNG, resulting in increased latency and bandwidth usage.
>
> There was also a mysterious issue where libwebp would effectively ignore
> the lossless quality setting and produce lossy images. By now, this may no
> longer be a problem, however I suspect the negative performance
> characteristics relative to PNG will still be there.
>
> If you would like to give it a try, by all means see whether things do
> improve, however the answer to your question is "yes, lossless WebP was
> investigated and ultimately rejected due to poor performance
> characteristics compared to PNG."
>
> - Mike
>

Re: WebP Lossless instead of PNG?

Posted by Mike Jumper <mj...@apache.org>.
On Fri, Aug 7, 2020, 06:30 Andras Sali <sa...@gmail.com> wrote:

> Hi Nick,
>
> Yes, thanks, I am aware that guacd already can use WebP if it's available.
> However if I see correctly, it is only used for **lossy compression** - the
> lossless flag is set to 0 (
>
> https://github.com/apache/guacamole-server/blob/master/src/common/surface.c#L1794
> ).
>
> WebP also supports lossless compression using a separate algorithm (
>
> https://developers.google.com/speed/webp/docs/webp_lossless_bitstream_specification
> ),
> which would be a direct alternative for PNG updates. In the benchmark I
> linked in my previous email, lossless webP encoding can be faster and more
> efficient for many types of images than PNG (question if this is also the
> case for screen updates).
>
> So I understand that guacd already intelligently switches between PNG /
> WebP Lossy depending on different metrics, however my question is regarding
> using WebP Lossless instead of PNG. In this case the switching would be
> between WebP Lossless and / WebP Lossy depending on the metrics.
>
> Has this already been tried and discarded for some reason?
>

Yes, waaayyy back when WebP support was first finding its way into
Guacamole, prior to the project moving to the ASF. There were mixed results
in our own testing, showing that WebP would often compress worse and slower
than PNG, resulting in increased latency and bandwidth usage.

There was also a mysterious issue where libwebp would effectively ignore
the lossless quality setting and produce lossy images. By now, this may no
longer be a problem, however I suspect the negative performance
characteristics relative to PNG will still be there.

If you would like to give it a try, by all means see whether things do
improve, however the answer to your question is "yes, lossless WebP was
investigated and ultimately rejected due to poor performance
characteristics compared to PNG."

- Mike

Re: WebP Lossless instead of PNG?

Posted by Andras Sali <sa...@gmail.com>.
Hi Nick,

Yes, thanks, I am aware that guacd already can use WebP if it's available.
However if I see correctly, it is only used for **lossy compression** - the
lossless flag is set to 0 (
https://github.com/apache/guacamole-server/blob/master/src/common/surface.c#L1794
).

WebP also supports lossless compression using a separate algorithm (
https://developers.google.com/speed/webp/docs/webp_lossless_bitstream_specification),
which would be a direct alternative for PNG updates. In the benchmark I
linked in my previous email, lossless webP encoding can be faster and more
efficient for many types of images than PNG (question if this is also the
case for screen updates).

So I understand that guacd already intelligently switches between PNG /
WebP Lossy depending on different metrics, however my question is regarding
using WebP Lossless instead of PNG. In this case the switching would be
between WebP Lossless and / WebP Lossy depending on the metrics.

Has this already been tried and discarded for some reason?

Many thanks,

Andras




András


On Fri, Aug 7, 2020 at 2:59 PM Nick Couchman <vn...@apache.org> wrote:

> On Thu, Aug 6, 2020 at 8:57 AM Andras Sali <sa...@gmail.com> wrote:
>
> > Hi,
> >
> > Has the use of a lossless version of WebP encoding been investigated
> > instead of PNG?
> >
> > According to the below benchmark (not sure how up-to-date), with a fairly
> > low compression setting (q=0, m=1) webp still needs on average less
> bytes /
> > pixel than PNG reference (Table 1), whilst being x2 faster for encoding
> > (Table 2):
> >
> > https://developers.google.com/speed/webp/docs/webp_lossless_alpha_study
> >
> > In general Guacamole performance is quite good, but when starting to
> scroll
> > it can lag substantially more than a direct RDP connection (even if the
> RDP
> > server is on the same host as guacamole server) - before the lossy WebP
> > kicks in. I would be curious if trying to use WebP consistently (also for
> > lossless, not just for high-framerate lossy setup) might improve somewhat
> > the responsiveness.
> >
> > Has anyone investigated this, or does this sound like a bad idea?
> >
> >
> So, first, guacamole-server (guacd) already supports the use of WebP if the
> correct libraries are installed at compile time.  Beyond this, guacd uses a
> variety of metrics to determine the best image format to use for sending
> images to the remote system, based on the available libraries on the system
> running guacd as well as the available image format support sent by the
> client.  Once the list of supported formats is negotiated between client
> and server, guacd makes decisions on which format to use based on how much
> of the screen is being updated, resource utilization on the server, and
> network link characteristics.
>
> There is no support for setting the image format to a specific format for
> the guacd instance.  The only way to accomplish this would be to tweak the
> the client such that it only sends a certain image format as its supported
> format, which would require tweaking the client-side code.
>
> -Nick
>

Re: WebP Lossless instead of PNG?

Posted by Nick Couchman <vn...@apache.org>.
On Thu, Aug 6, 2020 at 8:57 AM Andras Sali <sa...@gmail.com> wrote:

> Hi,
>
> Has the use of a lossless version of WebP encoding been investigated
> instead of PNG?
>
> According to the below benchmark (not sure how up-to-date), with a fairly
> low compression setting (q=0, m=1) webp still needs on average less bytes /
> pixel than PNG reference (Table 1), whilst being x2 faster for encoding
> (Table 2):
>
> https://developers.google.com/speed/webp/docs/webp_lossless_alpha_study
>
> In general Guacamole performance is quite good, but when starting to scroll
> it can lag substantially more than a direct RDP connection (even if the RDP
> server is on the same host as guacamole server) - before the lossy WebP
> kicks in. I would be curious if trying to use WebP consistently (also for
> lossless, not just for high-framerate lossy setup) might improve somewhat
> the responsiveness.
>
> Has anyone investigated this, or does this sound like a bad idea?
>
>
So, first, guacamole-server (guacd) already supports the use of WebP if the
correct libraries are installed at compile time.  Beyond this, guacd uses a
variety of metrics to determine the best image format to use for sending
images to the remote system, based on the available libraries on the system
running guacd as well as the available image format support sent by the
client.  Once the list of supported formats is negotiated between client
and server, guacd makes decisions on which format to use based on how much
of the screen is being updated, resource utilization on the server, and
network link characteristics.

There is no support for setting the image format to a specific format for
the guacd instance.  The only way to accomplish this would be to tweak the
the client such that it only sends a certain image format as its supported
format, which would require tweaking the client-side code.

-Nick