Patch for several KImageEffect improvements

Mosfet dan.duley at verizon.net
Tue May 27 02:55:28 BST 2003


Some time ago I ported quite a few effects from ImageMagick to Qt for 
KImageEffect. They haven't gotten all that much attention by me since then 
because I was using ImageMagick for my applications, but now I've been doing 
all the KDE lib work I wanted to get done for awhile and made several 
improvements and fixes :) Since I am dropping the ImageMagick requirement for 
future versions of PixiePlus these will be getting a lot more developer 
luvin' ;-)

The following effects have been totally rewritten:

Blur
Charcoal
Edge
Emboss
Equalize
Normalize
OilPaint
Sharpen

The most important fix is that some effects based on pixel neighborhoods had 
incorrect edges. Things like blur and edge detect, (which is used a lot), 
calculate pixels by looking at surrounding ones. I was incorrectly wrapping 
around the edges - which would use incorrect data and made the edges look 
funny. This has been fixed. 

In addition, previously many algorithms had their own matrix code. This was a 
lot of duplication and prone to error. This has been replaced with a general 
convolve function similiar to what is in recent ImageMagicks. This is both 
easier to maintain and provides visually better results. Almost all the above 
effects are now significantly more attractive.

Finally, when porting the first time I decreased the bit depth of things I 
didn't have to for stuff such as accumulators. While I compensated for the 
reduced resolution in the algorithms it made the results worse than what 
ImageMagick would create. This has been fixed and now ImageMagick and KDE 
should provide nearly identical results.

You can download the patch and see screenies here:

http://www.mosfet.org/effects/

To apply cd to your kdelibs folder and run something like:
patch -p0 < mosfet-effectspatch-0526.patch

Can someone please apply this? It should be binary compatible. It probably 
should be backported as well since it provides several fixes and 
improvements. If Gallium or someone wants to look this over and agrees then I 
can provide a patch for 3.1, too.

Thanks!




More information about the kde-core-devel mailing list