Uploaded image for project: 'Qt'
  1. Qt
  2. QTBUG-37431

QGraphicsBlurEffect produces artefacts

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Cannot Reproduce
    • Icon: Not Evaluated Not Evaluated
    • None
    • 5.2.1
    • Widgets: GraphicsView
    • None
    • Mac X.9.1

      Upon pixel size of image... smaller blur radius produces jittery effects... the blur radius value under which the artifacts is produced is depend upon pixel size of original image...

      Same algorithm was working fine on 4.8.5

      see attached image details (test shown was made on a 600x800 pixels image)
      1/ Original
      2/ Blur radius of 40
      3/ Blur radius of 41

      here is the code used...

      #include <QtGui>
      
      #if (QT_VERSION >= QT_VERSION_CHECK(5, 0, 0))
      #include <QtWidgets>
      #endif
      
      int main(int argc, char *argv[])
      {
          QApplication a(argc, argv);
      
          QGraphicsView view;
      
          QGraphicsScene *scene = new QGraphicsScene();
          view.setScene(scene);
      
          QImage image("ima600x800_original.png");
          qreal blur = 41;
      
          // render to QImage
          QPainter painter;
          painter.begin(&image);
          QGraphicsPixmapItem *pixmap = new QGraphicsPixmapItem ( QPixmap::fromImage(image), 0 );
          // apply the blur effect
          QGraphicsBlurEffect effect;
          effect.setBlurHints(QGraphicsBlurEffect::QualityHint); // PerformanceHint = 0x00, QualityHint = 0x01,
          effect.setBlurRadius(blur);
          pixmap->setGraphicsEffect(&effect);
          // add and render to scene
          scene->addItem(pixmap);
          scene->render(&painter);
      
          view.show();
      
          return a.exec();
      }
      

        1. test1-blur.png
          test1-blur.png
          8 kB
        2. test1.png
          test1.png
          18 kB
        3. ima600x800_original.png
          ima600x800_original.png
          104 kB
        4. ima600x800_blur41.png
          ima600x800_blur41.png
          33 kB
        5. ima600x800_blur40.png
          ima600x800_blur40.png
          83 kB
        No reviews matched the request. Check your Options in the drop-down menu of this sections header.

            bibr Andreas Aardal Hanssen
            eric_vi eric villa
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

              Created:
              Updated:
              Resolved:

                There are no open Gerrit changes