Box Blur and High Pass Lua Scripts

Hier können eigene Artweaver Materialien veröffentlicht und gedownloadet werden - Here you can publish custom Artweaver materials and download them.
peter
Beiträge: 15
Registriert: Do Feb 08, 2007 2:07 pm

Box Blur and High Pass Lua Scripts

Beitragvon peter » Di Mär 20, 2007 7:15 pm

Hi there,

here are two more filter scripts for use with Artweaver.

The first one is a high pass filter. What it does is it essentially filters the high frequency details in your image.

This is especially useful for sharpening photos. The resulting quality is vastly superior to what you can achieve with Unsharp Mask. There are other uses for a high pass filter, for example if you want to create seamless textures, but I won't be covering those here (check google for more info). Here is how to do the sharpening trick:

- Duplicate the layer you want to sharpen, which is usually the background layer
- Apply my high pass filter (Filters > Other > High Pass...). The higher the radius, the stronger the sharpening effect
- Set the blend mode of that layer to "Hard Light"
- If the sharpening effect is too strong for your taste, just lower the layer opacity. If it is not strong enough, either try a higher radius, or increase the contrast of the high pass layer by using Image > Adjustments > Brightness/Contrast.

In Photoshop (which ships with a high pass filter, so the technique works the same), you could also choose "Overlay" (which does not exist in Artweaver) or "Soft Light" (which for some reason brightens the image in Artweaver) if you like.

If you want to apply a special softening effect, just invert the high pass layer and the image gets a hazy quality without losing edge detail.

There is a second filter (which comes as a by-product of the high pass filter) which applies a Box Blur to your image. Its is very similary to a Gaussian Blur in its result.

IMPORTANT INSTALLATION NOTES: Make sure you have the Lua Scripting Plugin installed. If not, get it from the main Artweaver website.
Then Copy the two filter scripts into the default Artweaver Scripts directory, which is usually C:\Program Files\Artweaver 0.4\Standard\Lua Scripts\.

Then copy the Image Effect Library into Artweaver's Main directory, typically C:\Program Files\Artweaver 0.4\, NOT into the standard scripts directory. This is necessary since Artweaver only looks for Lua libraries in its main directory, not the scripts directory. The advantage of that is that more than one scrips can take advantage of the math in there.

If you are a scripts developer and want to use the functions in your own script, see the documentation of the library below.

Have fun
Peter
Dateianhänge
BoxBlurFilter.lua
Place this into C:\Program Files\Artweaver 0.4\Standard\Lua Scripts\.

The filter only works if you have libImFx.lua installed (see above).
(236 Bytes) 808-mal heruntergeladen
HighPass.lua
Place this into C:\Program Files\Artweaver 0.4\Standard\Lua Scripts\.

The filter only works if you have libImFx.lua installed (see above).
(265 Bytes) 816-mal heruntergeladen
libImFx.lua
Install this into C:\Program Files\Artweaver 0.4\. If you don't, the other two scripts won't work correctly.
(3.54 KiB) 924-mal heruntergeladen
Zuletzt geändert von peter am Di Mär 20, 2007 7:33 pm, insgesamt 3-mal geändert.

peter
Beiträge: 15
Registriert: Do Feb 08, 2007 2:07 pm

Beitragvon peter » Di Mär 20, 2007 7:23 pm

If you are a scripts developer, you can use the functions in the library in your own script. To do so, you have to reference the library first by putting the following line into the beginning of your script:

Code: Alles auswählen

require "libImFx"


Then you have access to the following functions:

libImFx.BoxBlur(radius): Applies a Box Blur with the given radius to the GLUAS image buffer.

r, g, b, a = libImFx.BoxBlurPixel(x, y, radius): Applies a box blur with radius of r to the pixel at x, y and returns the resulting color.

libImFx.HighPass(radius): Applies a high pass filter with the given radius to the image.

Be sure to use the GLUAS flush() command in your script where necessary, otherwise the results might not be as intended.

Make sure to check out the license in the libImFx.lua file before redistributing your script!!!


Zurück zu „Artweaver user materials“

Wer ist online?

Mitglieder in diesem Forum: 0 Mitglieder und 1 Gast