Results 1 to 5 of 5

Thread: QImage getting black areas for GIF frames

Threaded View

Previous Post Previous Post   Next Post Next Post
  1. #1
    Join Date
    Dec 2013
    Posts
    3
    Thanked 3 Times in 3 Posts
    Qt products
    Qt5
    Platforms
    Unix/X11

    Question QImage getting black areas for GIF frames

    I'm using a simple QImage program to look at frames from GIF animations. Occasionally the output image is corrupted, with black areas appearing over it. I have tried doing a simple export of the frames to files, in JPG, PNG, and GIF format and the results are the same. I've also verified the black areas are not transparency (although I've no idea how to set this in Qt if that were the case).

    This is the relevant code:

    QImage* image = new QImage();
    QImageReader* reader = new QImageReader(gif);
    reader->read(image);

    for(int index=0;index<=reader->imageCount();index++)
    {
    reader->jumpToNextImage();
    reader->read(image);
    QString frameName = dir + '/' + QString("out%1.jpg").arg(index,5,10,QChar('0'));
    image->save(frameName,"JPEG",100);
    }
    So I'm wondering if this is a known issue or if anyone else has encountered this? Or perhaps there are some changes required for certain colourspaces or something else I am not considering.

  2. The following user says thank you to elephant for this useful post:

    talbertypeter (7th December 2013)

Similar Threads

  1. Replies: 8
    Last Post: 13th May 2013, 14:36
  2. Dock widget allowed areas in QMainWindow
    By jpalbertini in forum Qt Programming
    Replies: 0
    Last Post: 28th January 2013, 11:36
  3. Replies: 2
    Last Post: 10th June 2011, 14:16
  4. How to make certain areas transparent with the desktop?
    By Sir Rogers in forum Qt Programming
    Replies: 5
    Last Post: 11th May 2010, 22:08
  5. QGraphicsView and adding QWidget with transparent areas
    By sting73 in forum Qt Programming
    Replies: 2
    Last Post: 28th April 2009, 11:19

Tags for this Thread

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Digia, Qt and their respective logos are trademarks of Digia Plc in Finland and/or other countries worldwide.