Sign in to follow this  
pavlik1307

Error diffusion dithering

Recommended Posts

This plugin allows you to reduce number of colors in an image with the help of eleven error diffusion dithering algorithms. You are able to choose one of the four software palettes. You can also enable "Serpentine scanning" to alternate scanning direction between lines. Unfortunately, these algorithms do not work quickly due to single-threadedness. The advantage of this plugin is correct work with any selection.

Plugin: Effects > Stylize > Error diffusion dithering

QG6BbQL.pngk7a3Wre.pngOKwPIuy.png

Examples:

dD2uW7f.pngdYLHgxu.pngQrW0Jcp.png

Download:

ErrorDiffusionDithering.dll

Edited by pavlik1307
  • Like 3
  • Upvote 1

Share this post


Link to post
Share on other sites

Why would someone want to apply dithering to their images these days?

^ This is not a rhetorical question.

 

9 hours ago, pavlik1307 said:

Plugin: Effects > Advanced > Error diffusion dithering

 

I recommend placing this effect into the Stylize menu.

Share this post


Link to post
Share on other sites

If the dithering algorithm locks bits and iterates through pixels with two for loops, replace the inner for loop with Parallel.For (look it up, it's easy to use) and you'll get some parallelization without much effort.

Share this post


Link to post
Share on other sites

@Joshua Lamusga, I can't parallelize dithering algorithm, because processing of following pixels depends on processing of previous pixels. But after your message, I realized that I could make neighbouring pixels be processed in parallel. I tried to use Parallel class with Partitioner class (to make processing more chunky). It works, but much longer than without parallelism. And I don't know why (I have experience using Parallel class, so it can't be my misunderstanding of its work).

Share this post


Link to post
Share on other sites

@Eli, my plugin implements eleven dithering algorithm. "Sierra Lite" and two other Sierra algorithms are already included. See the list of available algorithms below:

OKwPIuy.png

Edited by pavlik1307

Share this post


Link to post
Share on other sites

@Eli, I added "Black and white 2-color palette" to the plugin, because it is used on your sample image. Also, before applying dithering, I changed image contrast to 70. I achieved almost the same result as on Github, but it is slightly different. I think that github author made some preprocessing and other actions in his algorithms.

Preprocessed_Sierra_Light.jpg

Share this post


Link to post
Share on other sites

Thanks for the "Black and white 2-color palette" addition. The result is very close. I think that you should integrate in the effect contrast and brightnes sliders that way you should have better control over the results.

 

If you find out what other actions were applied in the Github example and add them to the effect would be nice too. The "wavy dithering" is very interesting.  It looks like the ones used on the presidents' portraits on the dollar bills.

Spoiler

Obverse_of_the_series_2009_$100_Federal_

 

Share this post


Link to post
Share on other sites
On 5/4/2018 at 5:32 PM, toe_head2001 said:

Why would someone want to apply dithering to their images these days?

^ This is not a rhetorical question.

Artistic effect or compatibility with very old games/softwares. Some older games have limited palette, and to reduce banding, dithering is used. If you are modding say Ultimate Ride Disney Coaster, you'd note that dithering is the only way to reduce banding in menu images. Some games are reduced to 256 colors, and dithering helps the issue of banding. For artistic effect, amiga images achieves have some very nice images of how low color and dithering can give a oil feel that is somewhat rough. But, I do agree that for modern softwares purpose, for all intents and purposes, dithering isn't very useful, and there's no point to it unless you have a taste for it or you specialize in pixel art.

 

Indexing still have use in separating colors for generating effects though. Threshold filter has some very useful niche usage for example.

Edited by Reptillian

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
Sign in to follow this