Results 1 to 4 of 4

Thread: Problem with change image format

Threaded View

Previous Post Previous Post   Next Post Next Post
  1. #4
    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: Problem with change image format

    Quote Originally Posted by danilodsp View Post
    But I want an image to grayscale representation of 8 bits (256 colors).
    Try building a 256 element grey colour table and then call the variant of QImage::convertToFormat() that takes a colour table and build an indexed image that way.

    If you want to do it manually then look at qGray(). Your simple average of R, G, and B values is not a good reflection of the perceived brightness of colours.
    Last edited by ChrisW67; 8th September 2011 at 07:05. Reason: Fixed fat-handed typing

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

    danilodsp (10th September 2011)

Similar Threads

  1. How to change current line format in QTextEdit?
    By FinderCheng in forum Qt Programming
    Replies: 5
    Last Post: 25th March 2011, 09:41
  2. change label format
    By kpr in forum Qwt
    Replies: 0
    Last Post: 15th February 2011, 09:44
  3. Replies: 0
    Last Post: 28th November 2010, 21:29
  4. TIFF image Format
    By dima in forum Qt Programming
    Replies: 7
    Last Post: 13th September 2010, 13:42
  5. How can change image format?
    By electronicboy in forum Qt Programming
    Replies: 2
    Last Post: 25th October 2009, 09: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.