Results 1 to 10 of 10

Thread: Posterizes an image with results identical to Gimp's Posterize command

Threaded View

Previous Post Previous Post   Next Post Next Post
  1. #1
    Join Date
    Oct 2010
    Posts
    15
    Thanks
    1
    Qt products
    Qt4
    Platforms
    Unix/X11

    Question Posterizes an image with results identical to Gimp's Posterize command

    How can i posterizes an image with results identical to Gimp's Posterize command? i've written the following code which make posterize with value 5, but it doesn't work correctly, cause the result image is not an identical to gimp's posterize tool at 5 value. it differs a little when i increase scale to 400% and look at result image and the image after gimp's posterize... any idea?

    Qt Code:
    1. for(int x=0; x<image.width(); x++)
    2. for(int y=0; y<image.height(); y++)
    3. result.setPixel(x, y, 51+51*(int)(qGray(image.pixel(x, y))/51));
    To copy to clipboard, switch view to plain text mode 


    PS: Posterize - it's reduce number of colors (is available, for ex., in GIMP at "Colors -> Posterize...")
    Last edited by suseway; 28th November 2010 at 12:23.

Similar Threads

  1. Alpha Channel support is broken for GIMP png and bmp files
    By mschifter in forum Qt Programming
    Replies: 3
    Last Post: 25th June 2015, 22:52
  2. How to edit selection with posterize and threshold
    By suseway in forum Qt Programming
    Replies: 0
    Last Post: 25th October 2010, 09:35
  3. PyQt QImage and BMP in 16bits 565 created from The Gimp
    By sebcbien in forum Qt Programming
    Replies: 0
    Last Post: 11th August 2010, 15:49
  4. GIMP and GPL
    By mhoover in forum General Discussion
    Replies: 1
    Last Post: 30th May 2010, 09:10
  5. Replies: 4
    Last Post: 14th July 2009, 04:27

Tags for this Thread

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.