Important: Please read the Qt Code of Conduct -

QtWebKit - pixelated since 4.8.0

  • Since 4.8.0 all animated elements in QtWebKit (I use Desktop on Windows, using mingw) are pixelated (and jagged, like they were scaled with a very simple algorithm) for a second and then they are smoothed (like they should be all the time). It's hard to explain in English for me. I tried all kind of settings but didn't manage to fix it. I even reported a bug: - but there seems to be nothing happening.

    The description from there: "Transforming images in QtWebKit from Qt 4.8.0 (QtWebKit 2.2.1) gives a pixelated image that after a second switches to smooth version. It looks very bad. It's on Windows XP using Qt 4.8.0. Steps to reproduce: scale a PNG image in img tag. Watch how it behaves after scaling."

    Is there a setting I could try?

    I make my QtWebView like that:

    this->ui->webView->setRenderHint(QPainter::Antialiasing, true);
    this->ui->webView->setRenderHint(QPainter::SmoothPixmapTransform, true);

    Here is a part of a screenshot - on the left is how the graphic looks when moving (in this case it's scrolling of a contents of a div, but it happens in every case when the png image is moving, scaling or rotating), on the right is how it looks after half a second when it stops.


    [Edit] Picture link fixed

  • Nothing? No one has this problem?

  • Bump.......

  • Moderators

    Do you have a small piece of sample code which could be used to try to replicate the problem?

  • Show any page using jquery in QtWebKit and use this code in Web Inspector:

    $('img').animate({'width':100}, 10000);

    It will slowly scale the images on the page - during that they will be pixelated and will suddenly jump to being smooth after the animation is done.
    It happens also when you set zoom for a webpage like that (so it's not jquery related):

    ui->webView->setZoomFactor(1.5); // anything other than 1.0


  • Moderators

    I suppose (having not tested this) that it may be a purposeful behavior, as it's not uncommon to disable smoothing while doing transforms due to the overhead of smoothing. In fact the QML docs actually suggest this for optimization purposes. (See the "Note" "here": )

    I'm not sure what goes on behind the scenes of QtWebKit, but if this is a common pattern, then it may just be the case.

    I don't have any solid answers, but just offering some comparative insight.

  • This is about text and the effect for images looks REALLY UGLY and it's not there in Qt 4.7.x or any browser I know. Also I didn't find any option to turn it off or on and it's also not always working (sometimes it stays pixelated). How can i turn it off? If I can't I will have to change the library to sth else that uses WebKit. :(

  • Moderators

    FWIW, the same note appears on the Image component's docs too. The gist was more about the concept than the specifics.

  • Also there is SmoothPixmapTransform - that should cover it. I have it turned on of course.

Log in to reply