This filter is intended for preparing images & video for display on devices with a limited colour range, e.g. small LCD panels. It is a filter for the excellent VirtualDub video editor, and can be used to process individual images as well as AVI files.
It uses dithering to reduce a 24 bit colour image to a smaller colour depth,
effectively trading off spacial resolution against colour depth.
It uses Floyd-Stienberg
error diffusion, with configurable spread weights and optional randomness to greatly
improve the number of perceived colours and reduce banding effects on gradual colour
gradients.
For processing individual frames, load the BMP file and use CTRL-2 to copy the destination frame to the clipboard. To process a random collection of bitmaps, number the files sequentially and use VirtualDub's load/save bitmap sequence option.
Dithered sample images below are stored as BMP files to avoid JPEG compression artefacts. The dithered images have a significant high-frequency content, and will suffer fom significat artefacts at all but the lowest JPEG compression levels.
Note that the filter does not change the image format, it just strips out the extra bits. To output 16 bit RGB in VirtualDub, select Video->Colour Depth->RGB(565) as the output format. Other formats may need additional reformatting to get to the required file format.
It is important that you do not apply any filtering to the dithered output, as teh dither pattern is likely to be impaired, so this filter should usally be the last filter in any processing chain.
Download : ErrDiffFilter.vdf. See http://virtualdub.com/virtualdub_filters.html if you don't know how to load filters.
24 Bit original |
16 Bpp 5:6:5 |
12 Bpp 4:4:4 |
8Bpp 3:3:2 |
4Bpp 1:2:1 |