Uploaded image for project: 'Guacamole'
  1. Guacamole
  2. GUACAMOLE-652

Grayscale mode for image data and dynamic control of image quality

Details

    • Improvement
    • Status: Closed
    • Major
    • Resolution: Invalid
    • None
    • None
    • guacamole
    • None

    Description

      Grayscale mode for image is the Magic Wand, when client is behind the poor internet bandwidth.

      The grayscale images up to 2-3 times smaller, but make no discomfort when work with 90% of tasks, except graphics.

      Switch the guacd <> client color and quality mode dynamic at protocol level will be the super improvement, so client able to analyze bandwidth switch the best performance mode.

      Attachments

        Activity

          mjumper Mike Jumper added a comment -

          guacd already does this. Prior to sending graphical updates, those updates are analyzed for content and frequency in order to determine what is likely to be best. Updates which appear photographic and update frequently enough are sent using lossy compression with quality varying based on analysis of client performance (GUACAMOLE-632). Updates which do not appear to be photographic are sent using lossless compression, with a 256-color palette automatically used if the image uses 256 colors or less. This will be the case for grayscale images by definition.

          mjumper Mike Jumper added a comment - guacd already does this. Prior to sending graphical updates, those updates are analyzed for content and frequency in order to determine what is likely to be best. Updates which appear photographic and update frequently enough are sent using lossy compression with quality varying based on analysis of client performance ( GUACAMOLE-632 ). Updates which do not appear to be photographic are sent using lossless compression, with a 256-color palette automatically used if the image uses 256 colors or less. This will be the case for grayscale images by definition.
          ua george added a comment -

          Something wrong here, I have image content like a native forms only, win32 style windows. I pick any redraw message in the socket, with big image, unpack it from base64 to png. Convert it to grayscale and I always have a result with size to 200% smaller.

          Also I am wrote simple test proxy for protocol, that unpack blob messages, and repack it with grayscale, overal amount of traffic also small up to 150-200%.

          ua george added a comment - Something wrong here, I have image content like a native forms only, win32 style windows. I pick any redraw message in the socket, with big image, unpack it from base64 to png. Convert it to grayscale and I always have a result with size to 200% smaller. Also I am wrote simple test proxy for protocol, that unpack blob messages, and repack it with grayscale, overal amount of traffic also small up to 150-200%.
          mjumper Mike Jumper added a comment -

          I'm not sure what you're saying about size reduction (the statement that something is 200% smaller does not make sense), but the overall concept behind the optimizer in the server is to balance bandwidth consumption with performance. If what you're suggesting is that Guacamole always send images in grayscale, or that an option be provided to force that behavior, I don't think that would be a good design decision. Automatically reducing quality even of images that would normally be sent in lossless form could make sense, but the decision whether to do so would need to be made carefully, and the heuristics involved would need to be fast enough that making the decision doesn't cancel out the benefit.

          To clarify, I'm not saying that Guacamole will automatically use grayscale for color images (which would result in an unnecessary reduction in image fidelity), but that an image that is already grayscale will automatically be sent as such. For graphical updates which are truly full color, the image will be sent losslessly preserving the content unless heuristics determine that the image would be better sent using a lossy format.

          If there is a graphical update that you think Guacamole should have automatically sent with reduced quality or fewer colors, I'd be interested to see the content of that update.

          mjumper Mike Jumper added a comment - I'm not sure what you're saying about size reduction (the statement that something is 200% smaller does not make sense), but the overall concept behind the optimizer in the server is to balance bandwidth consumption with performance. If what you're suggesting is that Guacamole always send images in grayscale, or that an option be provided to force that behavior, I don't think that would be a good design decision. Automatically reducing quality even of images that would normally be sent in lossless form could make sense, but the decision whether to do so would need to be made carefully, and the heuristics involved would need to be fast enough that making the decision doesn't cancel out the benefit. To clarify, I'm not saying that Guacamole will automatically use grayscale for color images (which would result in an unnecessary reduction in image fidelity), but that an image that is already grayscale will automatically be sent as such. For graphical updates which are truly full color, the image will be sent losslessly preserving the content unless heuristics determine that the image would be better sent using a lossy format. If there is a graphical update that you think Guacamole should have automatically sent with reduced quality or fewer colors, I'd be interested to see the content of that update.
          ua george added a comment -

          I meant force the color mode. I situation when client behind slow connection (like gsm network with high latency), situation when latency and cpu load on server side is no issue now, I have slow 500-900ms TTL and losses packets so the first question is the fastest delivery through network.

          Have ability to send to protocol:

          5.color.4.gray ( or 4 / 16 / 256 ... colors )

          or

          5.image.4.webp
          5.image.4.webp.2.70 ( quality )

           

          I attached real sample, I emulate slow 3g in chrome, frame rate isn't high,  guacd send png... 

          sample blob from guacd png = 23kb

          same image in grayscale + png = 12kb

          same image in webp + 70 quality factor = 6kb

           

          In this case, I want to  sacrifice with quality, server cpu load, but minimize network usage

           

          p.s. Jira have a broken the attach files function    Files here https://gofile.io/?c=QJgji1

          ua george added a comment - I meant force the color mode. I situation when client behind slow connection (like gsm network with high latency), situation when latency and cpu load on server side is no issue now, I have slow 500-900ms TTL and losses packets so the first question is the fastest delivery through network. Have ability to send to protocol: 5.color.4.gray ( or 4 / 16 / 256 ... colors ) or 5.image.4.webp 5.image.4.webp.2.70 ( quality )   I attached real sample, I emulate slow 3g in chrome, frame rate isn't high,  guacd send png...  sample blob from guacd png = 23kb same image in grayscale + png = 12kb same image in webp + 70 quality factor = 6kb   In this case, I want to  sacrifice with quality, server cpu load, but minimize network usage   p.s. Jira have a broken the attach files function    Files here  https://gofile.io/?c=QJgji1

          People

            Unassigned Unassigned
            ua george
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: