Results 1 to 4 of 4

Thread: negative images

  1. #1
    Join Date
    Nov 2007
    Posts
    103
    Thanks
    71
    Thanked 2 Times in 2 Posts
    Qt products
    Qt4
    Platforms
    Windows

    Default negative images

    How do you convert QImage and QPixmap (that are grayscale) to negative mode? Is there a function for that?

  2. #2
    Join Date
    Aug 2007
    Location
    Gorakhpur, India
    Posts
    254
    Thanks
    8
    Thanked 14 Times in 14 Posts
    Qt products
    Qt3 Qt4
    Platforms
    Unix/X11

    Default Re: negative images

    Quote Originally Posted by tommy View Post
    How do you convert QImage and QPixmap (that are grayscale) to negative mode? Is there a function for that?
    What Do you mean by negative mode?
    Anurag Shukla
    A man who never makes mistake is the man who never does anything! Theodre Rosvelt!

  3. #3
    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: negative images

    You have to negate each pixel in the image or negate each colour in the lookup table (depending on the mode of the image). To negate a grayscale color, you can use
    Qt Code:
    1. int v = 255-qGray(color.rgb());
    2. QColor result = QColor(v,v,v);
    To copy to clipboard, switch view to plain text mode 

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

    tommy (21st January 2008)

  5. #4
    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: negative images

    Or you can use QImage::invertPixels

Similar Threads

  1. Release build fails to find some resource images
    By MrGarbage in forum Installation and Deployment
    Replies: 3
    Last Post: 8th December 2007, 16:04
  2. Displaying real time images
    By Sheetal in forum Qt Programming
    Replies: 9
    Last Post: 22nd February 2007, 11:29
  3. How to display images in QTextBrowser ?
    By probine in forum Qt Programming
    Replies: 1
    Last Post: 12th January 2007, 08:58
  4. Replies: 1
    Last Post: 5th December 2006, 11:07
  5. JPEG Images not shown in QiconView using QT3??
    By darpan in forum Qt Programming
    Replies: 1
    Last Post: 4th August 2006, 20:34

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.