Disable transparency in QML Image

  • Is it possible to disable the transparency of an Image object in QML? Basically I'm loading an image and applying a heavy Gaussian blur on it. The problem occurs when the image has certain areas which are transparent. The blur takes these transparent pixels into account and it results in the blur becoming weaker.

    For example, this is the original image,


    When I apply Gaussian blur (500 samples) I get this:


    Notice that the image is still distinguishable (which it should not be at such a high blur)
    However, if I replace the transparent parts with black in the original image, like this:


    and then apply the same blur, I get the intended effect:


    As such I would like to know if it is possible to disable transparency in the QML Image component (which would essentially be compositing the transparent image on a colored background, and loading the new image).

  • I sorted it out by placing the Image inside an Item along with a black rectangle behind it. Applying Gaussian blur on the Item solves the issue.

Log in to reply