Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. QML and Qt Quick
  4. Disable transparency in QML Image
Forum Update on Monday, May 27th 2025

Disable transparency in QML Image

Scheduled Pinned Locked Moved Solved QML and Qt Quick
2 Posts 1 Posters 952 Views
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • S Offline
    S Offline
    samik
    wrote on last edited by
    #1

    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,

    0_1547248136384_f.png

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

    0_1547248243501_a.png

    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:

    0_1547248353340_f2.png

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

    0_1547248397101_b.png

    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).

    1 Reply Last reply
    0
    • S Offline
      S Offline
      samik
      wrote on last edited by
      #2

      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.

      1 Reply Last reply
      0

      • Login

      • Login or register to search.
      • First post
        Last post
      0
      • Categories
      • Recent
      • Tags
      • Popular
      • Users
      • Groups
      • Search
      • Get Qt Extensions
      • Unsolved