SeriousSam Posted April 16, 2009 Share Posted April 16, 2009 Convolution Effect Version 1.2 Out! I think I am a better programmer than artist... so I decided to contribute with a convolution effect. I kept the kernel at a 3x3 to be cpu friendly. Maybe in another release I will give an option to choose the size. In my implementation I have included a quick drop down to set the kernel to some of the more common kernels including an identity, blur, sharpen, mean removal, edge detection. laplacian, and emboss. But with quick modifications it can come up with some very interesting effects. Have fun . I have uploaded both the dll effect file and the VS2008 c# solution. The code was written in a very straight forward manor and should be easy to follow for anyone interested. [EDIT] V1.1 release Optimized code as much as could. I Measured speed improvements around 30% in the unoptimized debug version. In the release version my 4Ghz Duo Core will process a 1200x1600 image around 16ms. I think that is impressive without use of assembly and SIMD (Single instruction multiple data), never mind. I left the timer code in the release version. To see how long it took to process the scene in milliseconds pressing a button called "get" after rendering is done that will retrieve the time. [EDIT] V1.2 release Added File IO Support to save and load kernels. Kernels can be added and removed with a click of a button. When the Convolution Dialog is opened it looks for "ConvolutionEffectKernels.txt" in the "*\Paint.NET\Effects" Directory. This file contains the kernels. If the text file exist it will be loaded or will be created with the preset kernels. Also, if there are any problems opening or creating the file the preset kernels can still be used, however the ability to Add, Remove, Update and Restore will be disabled. I know file io is a lot of work... To add a kernel select "Add Current". A dialog will come up to give the kernel a name. The new kernel will be saved and added to the drop down list with the name assigned. To remove the selected kernel from the drop down click "Remove Current". To modify the selected kernel select "Update". This updates the selected kernel in the drop down with the text values. "Restore", will overwrite the "ConvolutionEffectKernels.txt" file with only the preset kernels. Any kernels created will be lost! I did not add a warning so be careful not to press this unless desired. ConvolutionEffect.zip ConvolutionEffectSln.zip Quote Link to comment Share on other sites More sharing options...
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.