Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. General and Desktop
  4. QPixmap Quality MacOS/Linux/Windows
Qt 6.11 is out! See what's new in the release blog

QPixmap Quality MacOS/Linux/Windows

Scheduled Pinned Locked Moved Unsolved General and Desktop
5 Posts 2 Posters 1.6k Views 2 Watching
  • 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.
  • R Offline
    R Offline
    roundcubes
    wrote on last edited by
    #1

    Hello,

    I use the option

    qApp->setAttribute(Qt::AA_UseHighDpiPixmaps);
    

    In order to obtain the best possible pixmaps, especially when scaling images.

    Under MacOS the images look very good (48x48px scaled to 16x16px or 32x32px). In the screenshot below you can see it

    alt Under MacOS

    On Linux and Windows, they look very bad, as if they had dragged them with paintbrush.

    alt Under Linux

    Is there another option, which works as under MacOS?
    With

    pstar = pstar.scaled(QSize(16,16),Qt::AspectRatioMode::KeepAspectRatio,Qt::SmoothTransformation);
    

    they looks under Linux better, but under MacOS bad :)

    They are drawn on QAbstractItemDelegate paint event by

    r = option.rect.adjusted (imageSpace, 0, 0, 0);
    r.setSize (Qsize (16,16));
    
    QPixmap pstar;
    pstar.load ( ":/smallimages/images32/star.png");
    
    Painter> drawPixmap (r, pstar);
    
    1 Reply Last reply
    0
    • SGaistS Offline
      SGaistS Offline
      SGaist
      Lifetime Qt Champion
      wrote on last edited by
      #2

      Hi,

      What size are your icons ?

      Interested in AI ? www.idiap.ch
      Please read the Qt Code of Conduct - https://forum.qt.io/topic/113070/qt-code-of-conduct

      R 1 Reply Last reply
      2
      • SGaistS SGaist

        Hi,

        What size are your icons ?

        R Offline
        R Offline
        roundcubes
        wrote on last edited by
        #3

        @SGaist Currently 48x48px, tested with 64x64px with same results.
        Only

        pstar = pstar.scaled(QSize(16,16),Qt::AspectRatioMode::KeepAspectRatio,Qt::SmoothTransformation);
        

        helped under Windows and Linux. But is not very beautiful, blurr quality.

        1 Reply Last reply
        0
        • SGaistS Offline
          SGaistS Offline
          SGaist
          Lifetime Qt Champion
          wrote on last edited by
          #4

          And what is the image original size ?

          Interested in AI ? www.idiap.ch
          Please read the Qt Code of Conduct - https://forum.qt.io/topic/113070/qt-code-of-conduct

          R 1 Reply Last reply
          0
          • SGaistS SGaist

            And what is the image original size ?

            R Offline
            R Offline
            roundcubes
            wrote on last edited by
            #5

            @SGaist The original size are 48x48px
            With SmoothTransformation i get better results, only on MacOS the quality looks perfect.

            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