Results 1 to 6 of 6

Thread: How to display 16 bit grayscale pictures?

Hybrid View

Previous Post Previous Post   Next Post Next Post
  1. #1
    Join Date
    Jun 2008
    Posts
    19
    Qt products
    Qt4
    Platforms
    MacOS X Windows

    Default How to display 16 bit grayscale pictures?

    How can I display 16 bit grayscale pictures?

  2. #2
    Join Date
    Oct 2006
    Location
    New Delhi, India
    Posts
    2,467
    Thanks
    8
    Thanked 334 Times in 317 Posts
    Qt products
    Qt4
    Platforms
    Unix/X11 Windows

    Default Re: How to display 16 bit grayscale pictures?

    Have u tried QPixmap?

  3. #3
    Join Date
    Jun 2008
    Posts
    19
    Qt products
    Qt4
    Platforms
    MacOS X Windows

    Default Re: How to display 16 bit grayscale pictures?

    I've used QImage because I want to modify the pixels.

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

    Default Re: How to display 16 bit grayscale pictures?

    So convert the image to QPixmap and display it.

  5. #5
    Join Date
    Jun 2008
    Posts
    19
    Qt products
    Qt4
    Platforms
    MacOS X Windows

    Default Re: How to display 16 bit grayscale pictures?

    To point it out I don't have a problem to display pictures but I don't know what Format I should use.

    With qRGB(value, value, value) do I only get a 8 bit grayscale, don't I?
    Last edited by reimer; 20th August 2008 at 15:51.

  6. #6
    Join Date
    Aug 2006
    Posts
    44
    Thanks
    10
    Thanked 1 Time in 1 Post
    Qt products
    Qt4
    Platforms
    Windows

    Default Re: How to display 16 bit grayscale pictures?

    You can only display 8-bit gray values on a standard computer screen, so you need to convert your data to 8 bit first. You can use adaptable min and max values to rescale. This way you can keep the original 16 bit in memory and let the user choose the scaling limits interactively.

    I use QImage::Format_Indexed8 with a color map where the R,G,B components are always equal to eachother.

Similar Threads

  1. Display only PNG image on desktop
    By durbrak in forum Qt Programming
    Replies: 32
    Last Post: 15th March 2008, 22:55
  2. Replies: 22
    Last Post: 7th December 2007, 10:01

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.