GIMP Chat http://gimpchat.com/ |
|
Gluas http://gimpchat.com/viewtopic.php?f=9&t=1847 |
Page 2 of 3 |
Author: | MareroQ [ Mon May 30, 2011 10:41 pm ] |
Post subject: | Re: Gluas |
Maybe for Ubuntu, well worth a try version 0.1.19 ? http://pippin.gimp.org/plug-ins/gluas/files/ |
Author: | mahvin [ Mon May 30, 2011 10:47 pm ] |
Post subject: | Re: Gluas |
I have those. I noticed the Japanese site had a couple that gimp-gluas doesn't have. |
Author: | Rod [ Tue May 31, 2011 4:03 am ] |
Post subject: | Re: Gluas |
Night Vision ![]() ![]() |
Author: | Rod [ Tue May 31, 2011 4:09 am ] |
Post subject: | Re: Gluas |
Here is the Kuwahara filter with curves after ward set to a cone line. Pretty cool grunge effect Lyle. ![]() ![]() |
Author: | PhotoComix [ Tue May 31, 2011 5:57 am ] |
Post subject: | Re: Gluas |
Fix the dogwaflle scripts should not be hard , replace the "dog" calls with a equivalent "gimp" call should fix, but i wonder if is worth the effort may be more interesting port script as Kuwahara to gmic or mathmap (the language seems a bit more similar to MM ) that for sure may support it. just in case somebody interested here the code |
Author: | Ronounours [ Tue May 31, 2011 6:05 am ] |
Post subject: | Re: Gluas |
Is there any code visible for the Kuwahara effect ? I think this could be done in G'MIC ![]() |
Author: | mahvin [ Tue May 31, 2011 6:06 am ] |
Post subject: | Re: Gluas |
It's hiding behind PC's spoiler |
Author: | PhotoComix [ Tue May 31, 2011 6:08 am ] |
Post subject: | Re: Gluas |
David maybe the original C script (well look as C to me , but i may be wrong) is easier to port. The Lua filter was derieved by this here #include <stddef.h> #include <imapio.h> #include <stdimap.h> /*----------------------------------------------------------------- Kuwahara Filter 12/01/99 filename: kuwahara.lc author : W.J.Bokhove ----------------------------------------------------------------*/ /* M_DOCDEF kuwahara NAME kuwahara SYNOPSIS void kuwahara(src, dst, lines) sep uchar src[]; /* source image */ /* sep uchar dst[]; /* destination image */ /* uint lines; /* number of lines to work on */ /* MEMORY CONSUMPTION This function consumes about 22 lines of IMAP memory DESCRIPTION Performs the Kuwahara Filter. This filter is an edge-preserving filter. ( a a ab b b) ( a a ab b b) (ac ac abcd bd bd) ( c c cd d d) ( c c cd d d) In each of the four regions (a, b, c, d), the mean brightness and the variance are calculated. The output value of the center pixel (abcd) in the window is the mean value of that region that has the smallest variance. M_DOCEND */ void kuwahara(sep uchar src[], sep uchar dst[], uint lines) { #define square(a) (a*a) int i; sep ulong dif; sep uint dtmp1, dtmp2, dtmp3, dtmp4, acc; sep uchar var[3], mean[3], vartmp, meantmp; dst[0] = 0; dst[1] = 0; /* Calculate Variance and Mean of first 2 lines */ dtmp2 = square((src[0] - :>src[1])); dtmp3 = square((src[0] - src[1])); dtmp4 = square((src[0] - :<src[1])); dif = :<dtmp2 + dtmp3 + :>dtmp4; dtmp1 = square((src[1] - :>src[1])); dif += dtmp1; dif += :<dtmp1; dtmp2 = square((src[1] - :>src[2])); dif += dtmp2; dtmp3 = square((src[1] - src[2])); dif += dtmp3; dtmp4 = square((src[1] - :<src[2])); dif += dtmp4; var[1] = dif; dif = :<dtmp2 + dtmp3 + :>dtmp4; dtmp1 = square((src[2] - :>src[2])); dif += dtmp1; dif += :<dtmp1; dtmp2 = square((src[2] - :>src[3])); dif += dtmp2; dtmp3 = square((src[2] - src[3])); dif += dtmp3; dtmp4 = square((src[2] - :<src[3])); dif += dtmp4; var[2] = dif; acc = src[0] + src[1] + src[2]; acc += (:<acc + :>acc); mean[1] = acc / 9; acc = src[2] + src[2] + src[3]; acc += (:<acc + :>acc); mean[2] = acc / 9; for (i=3 ; i<lines-1; i++ ) { /* Calculate Variance */ dif = :<dtmp2 + dtmp3 + :>dtmp4; dtmp1 = square((src[i] - :>src[i])); dif += dtmp1; dif += :<dtmp1; dtmp2 = square((src[i] - :>src[i+1])); dif += dtmp2; dtmp3 = square((src[i] - src[i+1])); dif += dtmp3; dtmp4 = square((src[i] - :<src[i+1])); dif += dtmp4; var[3]= sqrtsepi(dif>>3); /* Calculate Mean */ acc = src[i-1] + src[i] + src[i+1]; acc += (:<acc + :>acc); mean[3] = acc / 9; /* Find minimum variance and its mean */ vartmp = :>var[1]; meantmp = :>mean[1]; mif (:<var[1] < vartmp) {meantmp = :<mean[1]; vartmp = :<var[1];} mif (:>var[3] < vartmp) {meantmp = :>mean[3]; vartmp = :>var[3];} mif (:<var[3] < vartmp) meantmp = :<mean[3]; dst[i-1] = meantmp; var[1] = var[2]; mean[1] = mean[2]; var[2] = var[3]; mean[2] = mean[3]; } dst[lines-2] = 0; dst[lines-1] = 0; From http://web.archive.org/web/200803130937 ... uwahara.lc |
Author: | Ronounours [ Tue May 31, 2011 8:27 am ] |
Post subject: | Re: Gluas |
Ok, Thanks for the pointers. I've recoded it from scratch in G'MIC, it is quite short to perform in this beautiful language ![]() #@gmic kuwahara : size>0 #@gmic : Apply Kuwahara filter of specified size on selected images. #@gmic : $ image.jpg --kuwahara 5 kuwahara : -check $1>0 -e[^-1] "Apply Kuwahara filter of size $1 on image$?." -v - -to_rgb -repeat @# --dilate[0] $1 --erode[0] $1 -compose_channels[-1] min -compose_channels[-2] max --[-2,-1] $1,1,1,1,{1/$1} -convolve[0] [-1] -transpose[-1] -convolve[0] [-1] -rm[-1] -a[-2,-1] c -f "v1=i(x-1,y-1,0,3,1); \ v2=i(x+1,y+1,0,3,1); \ v3=i(x-1,y+1,0,3,1); \ v4=i(x+1,y+1,0,3,1); \ vm=min(v1,v2,v3,v4); \ if(c>=3,i, \ if(vm==v1,i(x-1,y-1,0,c,1), if(vm==v2,i(x+1,y-1,0,c,1), if(vm==v3,i(x-1,y+1,0,c,1), i(x+1,y+1,0,c,1)))))" -channels[-1] 0,2 -mv[-1] 0 -done -v + #@gimp Kuwahara filtering : gimp_kuwahara, gimp_kuwahara_preview(0) #@gimp : Radius = int(3,1,30) #@gimp : Channel(s) = choice("All","RGBA","RGB","Luminance","Blue/red chrominances","Blue chrominance","Red chrominance","Lightness","ab-components","a-component","b-component","Hue","Saturation","Value","Key","Alpha","ch-components","c-component","h-component") #@gimp : sep = separator(), Preview type = choice("Full","Forward horizontal","Forward vertical","Backward horizontal","Backward vertical") #@gimp : sep = separator(), note = note("<small>Author : <i>David Tschumperlé</i>. Latest update : <i>2011/05/31</i>.</small>") gimp_kuwahara : -apply_channels "-kuwahara $1",$2,0 gimp_kuwahara_preview : -gimp_split_preview "-gimp_kuwahara ${1--2}",$-1 I got this : ![]() Should be already available after filter update. |
Author: | PhotoComix [ Tue May 31, 2011 8:39 am ] |
Post subject: | Re: Gluas |
thank David I am wrong or the original filter was basically equivalent to a Convolution Matrix preset ? Something as the many presets (erode ,dilate,highpass,etc) that may be created by http://docs.gimp.org/2.6/en/plug-in-convmatrix.html ? |
Author: | lylejk [ Tue May 31, 2011 8:41 am ] |
Post subject: | Re: Gluas |
I agree; I think all the Gluas presets can be done (and better) in G'MIC if you know how to code. Gluas is quite old; want to say I vaguely remembered it in the old GIMP 1.2.x days. G'MIC is new and it's like comparing a corvette with a volkswagon beetle. lol And PC Ninja'ed me. lol ![]() |
Author: | Ronounours [ Tue May 31, 2011 8:47 am ] |
Post subject: | Re: Gluas |
@PhotoComiX : not it is quite different than applying a convolution filter. In fact, this is quite a strange process, I really doubt it can be useful for image denoising for instance. but who knows... |
Author: | lylejk [ Tue May 31, 2011 8:54 am ] |
Post subject: | Re: Gluas |
Hey David. Not sure what Kuwahara in Glaus is actually doing. It's almost like a combination of noise spread followed by and adaptive erosion or dilation depending on the value of the bits. Just not sure. Just tried out your new preset and it's not quite the same but cool none the less. What I find really cool with Kuwahara is to do the following. Dup, run the Glaus Kuwahara and then set that result to Grain Extract and copy visible. Delete the Glaus Kuwahar layer and then set the result layer to Grain Merge. Makes for a hyper sharpening effect. ![]() |
Author: | lylejk [ Tue May 31, 2011 9:56 am ] |
Post subject: | Re: Gluas |
Just found out that 0.1.20 doesn't run Decimation preset; bummer. Went back to 0.1.19 and all's well. Not sure what changes in 0.1.20 caused this preset to not work. Oh well. Like Decimation, so guess I'm sticking with 0.1.19 for now. ![]() |
Author: | Rod [ Tue May 31, 2011 10:49 am ] |
Post subject: | Re: Gluas |
Yeah Glaus 01.19 seems to run most of them. I agree GMIC could handle these way better and probably with cleaner code. Thanks David for the new filter by the way. ![]() |
Author: | Ronounours [ Tue May 31, 2011 11:26 am ] |
Post subject: | Re: Gluas |
I've just done a small correction, there was a bug in my code, sorry. Now, this looks a little better. |
Author: | Oregonian [ Tue May 31, 2011 11:31 am ] |
Post subject: | Re: Gluas |
Where is it? Is it something I need to put into my .gmic file? |
Author: | Ronounours [ Tue May 31, 2011 11:33 am ] |
Post subject: | Re: Gluas |
No, basically you should only click the 'Update filters' button, while the 'Internet' button is set. You need also G'MIC >= 1.4.9.2. The filter is located in folder 'Enhancement/Kuwahara filtering'. |
Author: | Oregonian [ Tue May 31, 2011 11:36 am ] |
Post subject: | Re: Gluas |
Thanks! Found it. |
Author: | Rod [ Tue May 31, 2011 11:40 am ] |
Post subject: | Re: Gluas |
Looks great David! ![]() ![]() |
Page 2 of 3 | All times are UTC - 5 hours [ DST ] |
Powered by phpBB © 2000, 2002, 2005, 2007 phpBB Group http://www.phpbb.com/ |