Hi, I have some problems using Magick++ with Qt. It's almost working, but almost in this case is not acceptable.

Qt Code:
  1. Magick::Image image;
  2. try {
  3. image.read(qPrintable(fileName));
  4. }
  5. catch (Magick::Exception &error_) {
  6. QMessageBox::warning(this, "Error!", QString("%1").arg(error_.what()));
  7. return QPixmap();
  8. }
  9.  
  10. Magick::Blob blob;
  11. image.write(&blob, "XPM");
  12.  
  13. QPixmap pixmap;
  14. pixmap.loadFromData((char*)blob.data(), "XPM");
  15. return pixmap;
To copy to clipboard, switch view to plain text mode 
This code does it's thing, but...
Qt Code:
  1. image.write(&blob, "XPM");
To copy to clipboard, switch view to plain text mode 
takes 4 seconds, and the displayed image looks like lost some of it's quality.

Qt Code:
  1. Magick::Image image;
  2. try {
  3. image.read(qPrintable(fileName));
  4. }
  5. catch (Magick::Exception &error_) {
  6. QMessageBox::warning(this, "Error!", QString("%1").arg(error_.what()));
  7. return QPixmap();
  8. }
  9.  
  10. QImage img(image.columns(), image.rows(), QImage::Format_RGB32);
  11. Magick::ColorRGB rgb;
  12. for (int x = 0; x < img.width(); x++) {
  13. for (int y = 0; y < img.height(); y++) {
  14. rgb = *image.getPixels(x, y, 1, 1);
  15. QColor color(rgb.redQuantum(), rgb.greenQuantum(), rgb.blueQuantum());
  16. img.setPixel(x, y, color.rgb());
  17. }
  18. }
  19. return QPixmap::fromImage(img);
To copy to clipboard, switch view to plain text mode 

There's no noticeable delay now when loading image, but displayed image has wrong colors (gets blue-ish kinda).
I tested this code also with image 1x1 which had color (R: 183, G: 113, B: 51), but Magick++ returns it as (R: 113, G: 51, B: 51).

The problems might be more Magick++ related, but perhaps someone knows what's wrong or has managed to load image in other way without problems?