Results 1 to 2 of 2

Thread: Image conversion black and white

  1. #1
    Join Date
    Nov 2009
    Posts
    16
    Thanks
    2
    Qt products
    Qt4 Qt/Embedded
    Platforms
    Unix/X11

    Default Image conversion black and white

    How can I turn a picture black and white format.

  2. #2
    Join Date
    Feb 2007
    Location
    Karlsruhe, Germany
    Posts
    469
    Thanks
    17
    Thanked 90 Times in 88 Posts
    Qt products
    Qt4
    Platforms
    Unix/X11 Windows

    Default Re: Image conversion black and white

    You asked this same question two weeks ago!

    What about

    Qt Code:
    1. image = image.convertToFormat(QImage::Format_Mono);
    To copy to clipboard, switch view to plain text mode 

    as aamer4yu suggested?

    If you want more control look into the sourceCode in qimage.cpp. ConvertToFormat uses an Image_Converter_Map. The one to mono is called "convert_X_to_Mono", which calls "dither_to_Mono" and uses qGray (perceptual mix of RGB) and a treshold of 128.

    If that's not what you are looking for, you need to elaborate more!

    Johannes

Similar Threads

  1. İmage Convert Black and White
    By offline in forum Qt Programming
    Replies: 1
    Last Post: 8th March 2010, 05:08
  2. QGLWidget renders black
    By jonasbalmer in forum General Programming
    Replies: 2
    Last Post: 24th January 2010, 15:32
  3. Displaying Text on Black and White Screen
    By Stobie in forum Qt for Embedded and Mobile
    Replies: 4
    Last Post: 8th December 2009, 01:03
  4. Printing plot black & white
    By maybe78 in forum Qwt
    Replies: 4
    Last Post: 9th October 2009, 07:39
  5. image conversion speed?
    By tommy in forum Qt Programming
    Replies: 2
    Last Post: 30th January 2008, 06:49

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.