Distorted images while compressing images with text

41 views
Skip to first unread message

Ramesh Kumar

unread,
Jun 3, 2017, 3:36:33 PM6/3/17
to WebP Discussion

I had been using GDI+ & CxImage libraries for saving my images captured from the desktop and thought of moving to google's LibWebp as it is promising good quality images with better compression than JPEG or PNG.


I capture the desktop either using using directX or GDI on windows, encode and save them or transfer over the network and decode them on the other side. Every thing looks good except that the images captured with text are distorted but the same is not happening for web pages with heavy text content.

The texts are encoded properly whenever the background color changes(either being selected or highlighted). I do not understand what the problem is.


here is an image that was compressed using libwebp, you can clearly see that the selected area is encoded properly and the rest are randomly distorted.





Here is the webpConfig I used for compression


    m_webp_config.quality                       = 50;
    m_webp_config.alpha_quality            = 0;
    m_webp_config.lossless                    = false;
    m_webp_config.method                     = 3;
    m_webp_config.alpha_compression  = false;
    m_webp_config.alpha_filtering           = false;
    //m_webp_config.sns_strength           = 0;

    m_webp_config.use_sharp_yuv          = false;
    m_webp_config.autofilter                    = false;
    m_webp_config.filter_type                  = 0;
    m_webp_config.filter_sharpness        = false;
    m_webp_config.filter_strength            = 0;
 
    m_webp_config.near_lossless            = false;
    m_webp_config.thread_level              = 1;


I couldn't figure out what I am doing wrong. Can any one help me fix the issue? Thanks in advance.

Ramesh Kumar

unread,
Jun 4, 2017, 8:02:49 AM6/4/17
to WebP Discussion
Update:

This is how the images look when it is captured and saved using webp. Can anyone help me?

Auto Generated Inline Image 1

Ramesh Kumar

unread,
Jun 4, 2017, 8:59:33 AM6/4/17
to WebP Discussion
I'm usin WebPPictureImportRGBA to import RGBA buffer into WebPPicture. Is this wrong? Then how come the same works for web pages with a lot of text that too with alpha?


On Sunday, June 4, 2017 at 1:06:33 AM UTC+5:30, Ramesh Kumar wrote:

Pascal Massimino

unread,
Jun 6, 2017, 10:38:36 AM6/6/17
to WebP Discussion
Hi,

On Sun, Jun 4, 2017 at 2:59 PM, Ramesh Kumar <ramesh...@gmail.com> wrote:
I'm usin WebPPictureImportRGBA to import RGBA buffer into WebPPicture. Is this wrong? Then how come the same works for web pages with a lot of text that too with alpha?

These are the typical artifact you'd see when compressing low-color screen capture using a lossy format. You may want to raise the compression quality (config->quality),
but there's only so much it can help. The conversion from ARGB to sub-sampled YUVA is the real problem here.

Accordingly, you may want to instead:
  - use lossless compression for this sort of input  (config->lossless = 1).
  - make sure you're not using a conversion from RGBA to YUVA during the import. To that effect, you should make sure that WebPPicture::use_argb is set to '1', to prevent
    such conversion and make the lossless compression work on real  original samples.

hope it helps!
skal/

--
You received this message because you are subscribed to the Google Groups "WebP Discussion" group.
To unsubscribe from this group and stop receiving emails from it, send an email to webp-discuss+unsubscribe@webmproject.org.
To post to this group, send email to webp-d...@webmproject.org.
Visit this group at https://groups.google.com/a/webmproject.org/group/webp-discuss/.
For more options, visit https://groups.google.com/a/webmproject.org/d/optout.

Ramesh Kumar

unread,
Jun 15, 2017, 3:47:56 PM6/15/17
to webp-d...@webmproject.org
Thanks a lot Pascal, That works.


Regards,
Ramesh.
Reply all
Reply to author
Forward
0 new messages