Results 1 to 3 of 3

Thread: Is QImage BMP lossless?

  1. #1
    Join Date
    Nov 2012
    Posts
    1
    Thanks
    2
    Qt products
    Qt4
    Platforms
    Windows

    Default Is QImage BMP lossless?

    Hi,

    I hope this question is not inappropriate. I wonder if the BMP created by the QImage::save() method creates a lossless bitmap? I know that MS Paint somehow losses the quality when saved (it is even possible to see the lower quality at save time). How about the QImage class?

    Thanks.

  2. #2
    Join Date
    Jan 2006
    Location
    Warsaw, Poland
    Posts
    33,368
    Thanks
    3
    Thanked 5,017 Times in 4,793 Posts
    Qt products
    Qt3 Qt4 Qt5 Qt/Embedded
    Platforms
    Unix/X11 Windows Android Maemo/MeeGo
    Wiki edits
    10

    Default Re: Is QImage BMP lossless?

    BMP doesn't have any internal compression (as far as I know) thus by design it is loseless. If Paint indeed causes some loss in quality, it is because of Paint, not BMP.
    Your biological and technological distinctiveness will be added to our own. Resistance is futile.

    Please ask Qt related questions on the forum and not using private messages or visitor messages.


  3. The following user says thank you to wysota for this useful post:

    jajcek (8th November 2012)

  4. #3
    Join Date
    Mar 2009
    Location
    Brisbane, Australia
    Posts
    7,729
    Thanks
    13
    Thanked 1,610 Times in 1,537 Posts
    Qt products
    Qt4 Qt5
    Platforms
    Unix/X11 Windows
    Wiki edits
    17

    Default Re: Is QImage BMP lossless?

    There are various forms of BMP, some with lossless run-length encoding, none with lossy image compression like JPEG. Taking a 24-bit image and putting it in a 24-bit BMP will not be lossy. Any alpha channel from a 32-bit image may be lost because only recent variants of BMP support it. Also if Qt (or Paint) produces a 16-bit or colour mapped BMP then it will be lossy with respect to the original image. It seems the Qt output code will do the right default thing from a cursory inspection of the source (src/gui/image/qbmphandler.cpp).

  5. The following user says thank you to ChrisW67 for this useful post:

    jajcek (8th November 2012)

Similar Threads

  1. Replies: 5
    Last Post: 16th May 2011, 21:15
  2. QImage
    By hazardpeter in forum Newbie
    Replies: 2
    Last Post: 31st July 2009, 15:19
  3. What's faster: QPixmap-to-QImage or QImage-to-QPixmap
    By forrestfsu in forum Qt Programming
    Replies: 2
    Last Post: 15th December 2006, 17:11
  4. QImage
    By mickey in forum Qt Programming
    Replies: 7
    Last Post: 14th July 2006, 21:54
  5. Replies: 3
    Last Post: 15th March 2006, 11:44

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
  •  
Qt is a trademark of The Qt Company.