Adding a gradient and dithering filter, such as gradfun from libavfilter, would be rather useful for images saved at low bit-depths being rendered at higher ones, by smoothing out gradients that create banding effects (i.e. instead of a smooth gradient you have several noticable "bands" or "bars" of color from one shade to the other)
It also makes the image look a lot "cleaner" overall without smoothing it out. The improvement should be noticeable if it is being rendered at a higher bit-depth than it was saved in, or if it was saved in a lossy format such as GIF (which already has a terrible bit-depth) or JPEG. It won't make much, if any, difference on PNG or BMP images being rendered at the same bit-depth they were stored at unless there was a conversion to a lower bit-depth somewhere along the way in its creation.
There are improved versions of gradfun out there, but they aren't implemented purely in C or C++ code, so they would be harder to implement.
We looked around for easy to implement filters earlier without much luck. It would definitely be worth it to check out gradfun. Do you know how its implemented? Can you simply pass an image in and get a clean one out?
The source from libav is inside libavfilter/vf_gradfun.c (there is an x86/gradfun.c, but that only adds some assembly definitions and functions specific to MMX/SSE2/SSE3). The function you'd call for processing a static image is:
static void filter(GradFunContext *ctx, uint8_t *dst, uint8_t *src, int width, int height, int dst_linesize, int src_linesize, int r)
The option naming is a little funny...so I'll look into exactly what each one is. Otherwise the code looks pretty straightforward and doesn't seem to rely on much built into libav.
On the downside, I did just note that this code is lgpl which would tie vile to lgpl if it gets statically linked in. I can look around for similar filters written in GPL'd code.
Actually, I found an old friend of mine...an AVISynth plugin that provides C++ source code and x86 assembler. If we can find someone to port the assembler code to different architectures or work around it, this would be a rather nice addition.
It is also GPL'd,
Source+DLL:
http://kosmos.kawaii-shoujo.net/gradfun2db/gradfun2db-v1.0.zip