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

PPM image loader incorrectly scales color component values

    XMLWordPrintable

Details

    • Bug
    • Resolution: Done
    • Not Evaluated
    • 5.9
    • 4.7.2
    • Image formats
    • None

    Description

      The PPM (P6) image format allows to specify the maximum color value, which is usually 255 for 8 bit images, and 65535 for 16 bit images. The PPM loader has two bugs when scaling values where max is not 255.

      First, when max < 255 it does not scale at all, making images look too dark.

      Second, when max > 255 it scales the 0 value to -1, resulting in 255 when packed into qRgb. Attached is a 16 bit PPM image (max = 65535) that has only red pixels (rgb FFFF 0000 0000, but is loaded as white (rgb FF FF FF).

      Attachments

        No reviews matched the request. Check your Options in the drop-down menu of this sections header.

        Activity

          People

            vgt Eirik Aavitsland
            cfeck Christoph Feck
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved:

              Gerrit Reviews

                There are no open Gerrit changes