Results 1 to 4 of 4

Thread: Dithering

  1. #1
    Join Date
    Sep 2010
    Posts
    36
    Thanks
    1

    Default Dithering

    Hello.

    I've written a GUI application for Windows CE 6 with Qt 4.7.0 embedded.

    The device on which the application runs support 'only' 16 Bit colordepth.

    I've noticed that e.g. gradients doesn't look very smooth. The color doesn't 'fade smoothly' into the other, but 'make hard steps'.

    I've compared this with the MFC version of my application which I wrote before I switched to Qt. Here this appears to be smoother.

    So I've took a closer look and discovered that MFC seems to use a dithering method which look like Floyd-Steinberg algorithm.

    How can I achieve this with Qt?

    I've attached images of a Qt version and a MFC version (both in original size and 4x zoomed version) of a gradient from #ffffff to #a1a1a1 where the effect can be seen.

    Thank you
    Attached Images Attached Images

  2. #2
    Join Date
    Sep 2010
    Posts
    36
    Thanks
    1

    Default Re: Dithering

    ***push***

  3. #3
    Join Date
    Sep 2010
    Posts
    36
    Thanks
    1

    Default Re: Dithering

    Nobody any ideas?

  4. #4
    Join Date
    Nov 2010
    Posts
    16
    Thanked 1 Time in 1 Post

    Default Re: Dithering

    You can create a 'swatch' of dithered gradient yourself and then paint it as a background image. There are lots of dithering algorithms on the network. I looked and someone has started a Qt4.7 branch with dithering support. I think I was googling 'Qt dithering'.

    I didn't find support for dithering in Qt. Font anti-aliasing is actually similar. I think this might be closer to what you want. For example, use an even amount of pixels to extend the gradient. The simple gradient with 2bits would be 0, 1, 2, 3. Extending to two pixels 00, 01, 11, 12, 22, 23, 33, etc. It might be easier to code this stepping directly as dithering is more generic with any type of color transitions possible.

    hth.

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.