Reptorian G'MIC Filters

Solved it!

Note how it goes into the center while still having influence factor.

1 Like

With progress like that, you will be done in no time. :+1:

It’s already submitted to g’mic community as I didn’t see any bugs. The only thing that could go wrong at this point if that if copied and paste badly into g’mic community. I always save updatexxxx.gmic into another location for backup purpose. I doubt I did copy and pasted wrong though.

1 Like

New project - “True” Autochrome Stimulation. I will making a sublevel filter to stimulate true autochrome.

But, first CLUT suggestions. I got the palette ready for stimulation.

Other news - I added amiga7800 (mess, pal, ntsc), sam coupe, vga, deluxe paint palettes. Not much is missing besides a few hardware pals and usermade palettes.

Here is some sources to missing pals - Retrograde Palettes by Arvin61R58 on DeviantArt

I will add fornax void too.


@hover

I am near at a point where I’ll be rewriting the Concrete Material Texture for new features altogether, besides the seamless issue, I believe I could use several different ideas. As many as possible. But then again, I might work on true autochrome stimulation, though it’s one or the other at this point.

Here’s on my backnotes -

  • Color Blending Factor - Forces the result to stay within a certain colors
  • A-B Contrast - Lower Contrast means less blue and/or yellow and/or less red and/or green. And higher contrast means more saturation on blue, yellow, green, red.
  • Fix seamless-ness
  • Local Contrast

Some ideas I just thought off

  • Minibumps- This just add a mini bumps surface over the concrete material.
1 Like

Now that I have added 18 new palette (I don’t think I’ll add anymore palettes, 159 palettes are enough), and fixed nebulous further. Pixel artists shouldn’t be missing much now. I added a couple of hardware palettes in case any one wants to stimulate old hardware without the use of my reduced color transfer color filter. I am now at the point where I’ll be fixing the Concrete Material Texture by rewriting it altogether. Just want to say this out there.

2 Likes

Took a little break from rewriting the filter. For those who wants to know what I have so far on that, here it is.

#@gui Construction Material Texture : _cons_turb, _cons_turb_preview(0)
#@gui :  note  = note("Construction Material Texture filter is based off the following tutorial by <b>theonlychad</b> for Paint.NET software: <a href="https://forums.getpaint.net/topic/16075-concrete-texture-tutorial/">Concrete Texture Tutorial</a>.\n"), sep = separator()
#@gui : 1. Radius  = float(88,1,1024)
#@gui : 2. Octaves  = int(8,1,12)
#@gui : 3. Damping per Octave  = float(2.5,1,10)
#@gui : 4. Mode  = choice(2,"Turbulence","Turbulence 2","Fractal Noise","Fractured Clouds","Stardust","Pea Soup")
#@gui : 5-7. Plasma Color Balance = color(128,128,128)
#@gui : 8-10. Color Layer  = color(128,128,128)
#@gui : 11. Hue Blending (%) = float(50,0,100)
#@gui : 12. Saturation Blending (%) = float(50,0,100)
#@gui : 13. Equalize Factor (%) = float(0,0,100)
#@gui : 14. Amplitude  = float(20,0,200)
#@gui : 15. Noise Type  = choice(3,"Gaussian","Uniform","Salt and Pepper","Poisson")

#@cli plasma_repvers:
plasma_repvers:
repeat $! l[$>]
-m "MergeChoice : $""=_blend_a" -MergeChoice "add","alpha","and","average","blue","burn","darken","difference","divide","dodge","exclusion","freeze","grainextract","grainmerge","green","hardlight","hardmix","hue","interpolation","lighten","lightness","linearburn","linearlight","luminance","multiply","negation","or","overlay","pinlight","red","reflect","saturation","screen","shapeaverage","softburn","softdodge","softlight","stamp","subtract","value","vividlight","xor","edges","error"

-m "MergeChoice : $""=_blend_b" -MergeChoice "add","burn","dodge","exclusion","freeze","grainextract","grainmerge","hardlight","hardmix","interpolation","linearburn","linearlight","luminance","multiply","negation","overlay","pinlight","reflect","screen","shapeaverage","softburn","softdodge","softlight","stamp","vividlight","edges","error"

r 100%,100%,100%,3
f 0
turbulence $1,$2,$3,0,$4 
balance_gamma $5,$6,$7
.
.
+f.. $8,$9,$10
blend[-1,-2] hue,$11
rv[-1,-2]
blend[-1,-2] saturation,$12
rv blend luminance
+equalize n. 0,255
blend alpha,$13
ac "_fx_noise $14,$15",{$15>6?$16+1:$16},$17
rgb2lab
s c
f... "
csd=($16+1)/2;
cde=1-csd;
cde?(csd/cde)*i+($17*100):(i+($17*100)>50?100);
"
cut... 0,100

f.. "
cla=($18+1)/2;
cra=($19+1)/2;
clsa=cla;
clsb=1-cla;
clsa_f=clsb>0?clsa/clsb*i:-100;
crsa=cra;
crsb=1-cra;
crsa_f=crsb>0?crsa/crsb*i:100;
i<0?clsa_f:crsa_f;
"
f. "
cla=($20+1)/2;
cra=($21+1)/2;
clsa=cla;
clsb=1-cla;
clsa_f=clsb>0?clsa/clsb*i:-100;
crsa=cra;
crsb=1-cra;
crsa_f=crsb>0?crsa/crsb*i:100;
i<0?clsa_f:crsa_f;
"
cut -100,100
a c
lab2rgb
+jr_desaturate $22,$23,$24,$25,$26
blend normal,$27
.
+blend ${_blend_b{$28+1}},$29
rm..
blend ${_blend_a{$30+1}},$31
if $33 negate fi
if $32 
if {$32==1} cut 0,255
elif {$32==2} n 0,255
fi fi
fx_warp_by_intensity ${33-40}
fx_make_seamless {w>h?h/2:w/2}
if {$41==1} if {$42==0} blur $40 fx_butterworth_bp ${43-47},0,${48-49} if {$50==1} +emboss_image $51,{$52/100},$53 fi else +fx_butterworth_bp ${43-47},0,${48-49} blur[0] $40 if {$50==1} emboss_image[1] $51,{$52/100},$53  fi fi
elif {$43==0} blur $40 if {$50==1} +emboss_image $51,{$52/100},$53  fi fi
if {$50==1} if $54 blend grainmerge,$55/100 else blend grainextract,$55/100 fi fi
endl done

And, here’s a new toy to play with. Based on a source code found on PDN forum. Fun to play with. Just change the angle.

r2dx {3*100}%,5
f "
Ang=140;
BulgeAng=Ang*(pi/180);
cX=w/2;
cY=h/2;
vx=cX-x;
vx=(vx^2)/cX;
vy=(y^2)/cY;
vx=(x+(x-vx)*cos(BulgeAng)+(y-vy)*sin(BulgeAng));
vy=(y+(x-vx)*sin(BulgeAng)+(y-vy)*cos(BulgeAng));
i(vx,vy,z,c,5,3);
"
r2dx {100/3}%,5

@afre Question though, was it really necessary for me to do R,G,B,A? I don’t know how to get it to work without doing that.

I think you could use c to propagate through the channels.

Tested and it worked. I saw the omit note on g’mic. Another thing that’s easy to miss.

I think you’ll like what I did.

Source - https://www.pexels.com/photo/person-on-boat-docked-on-side-of-sidewalk-at-venice-grand-canal-2278885/

iw={w}
ih={h}

f "
x_offset=w/2*1;
y_offset=h/2*1;
Amount3=20;
ly=y==0?log(10^-8)*Amount3:log(y^2)*Amount3;
lx=x==0?log(10^-8)*Amount3:log(x^2)*Amount3;
nx=(1?-1:1);
ny=(1?-1:1);
vx=x+ly*nx;
vy=y+lx*nx;
vx-=x_offset*nx;
vy-=y_offset*nx;
i(vx,vy,z,c,4,(1?3:2));
"

r {w*.5},{h*.5},100%,100%,3
r $iw,$ih,100%,100%,0,3,0,1

Based off Asmageddon Inverto Distortion Paint.NET plugin source code, I added into a few things.


New post as of 5/26/2019

Got a question guys, is the description of dimension reference ok? I’m not so sure if it is understandable. Without the dimension reference, the output of preview is dependent on preview dimension rather than internal dimension processing.

#@cli rep_strbulkal: (eq. to rep_strange_bulge_kaleidoscope)
rep_strbulkal:rep_strange_bulge_kaleidoscope $*
#@cli rep_strange_bulge_kaleidoscope:0<=_bulge_ang<=360,_axis_of_bulge= { 0=horizontal | 1=vertical },_scale>0,-1<_offset_main_x<=1,-1<_offset_main_y<=1,-1<_offset_kaleido_x<=1,-1<_offset_kaleido_y,<=1,_dimension_reference>0,1<=_interpolation<=5,_boundary_condition= { 0=Periodic | 1=Mirror }
#@cli:_dimension_reference refers to the base dimension used for calculation of bulging, it uses the biggest dimension as a reference for scaling. The PDN version of Strange Bulger Kaleidoscope does not have a dimension reference which means that bulges are dependent on the image size. This is to ensure that preview stays consistent with the end result. What you see is what you get as _dimension_reference variable is a internal dimension processing variable.
rep_strange_bulge_kaleidoscope:
if $3<10^-8 v + error "Scale cannot be 0 or less than 0!" v - fi
if $8==0 v + error "dimension_reference cannot be 0!" v - fi
if $9<1 v + error "interpolation cannot be less than 1" v - fi

shift {50*$4}%,{50*$5}%,0,0,3,1

f "
BulgeAng=$1*(pi/180);
sd=w/h;
ed=$8;
ix=(x/w)/(h>w?1/sd:1);
iy=(y/h)/(w>h?sd:1);
iw=w/(h>w||w==h?1/sd:1);
ih=h/(w>h||w==h?1:1/sd);
id=w/h?ed/w:ed/h;
iw*=id;
ih*=id;
cx=iw/2;
cy=ih/2;
xx=sqrt(abs(ix*ed-cx+cx*$6));
yy=sqrt(abs(iy*ed-cy+cy*$7));
xx*=$3*1/ed;
yy*=$3*1/ed;
xx*=10000;
yy*=10000;
vx=$2?xx:cx-xx;
vy=$2?cy-yy:yy;
vx=vx^2/cx;
vy=vy^2/cy;
vx=(xx+(xx-vx)*cos(BulgeAng)+(yy-vy)*sin(BulgeAng));
vy=(yy+(xx-vx)*sin(BulgeAng)+(yy-vy)*cos(BulgeAng));
vx*=w/ed;
vy*=h/ed;
i(vx,vy,z,c,$9,($10?3:2));
"
"
1 Like

Stuck on a roadblock here, if I change the angle by 45, I get some rounding errors. Any good around to this problem? Hmm, I may actually attempt to use rotate nearest instead to see if I can get around that. Or new layer, and use hypotenuse for each side, and then crop that afterward after I rotate it. It’s not going to be the same result unfortunately.


#@cli rep_binaltquadtex: (eq. to rep_binary_alterating_quad_texture)
rep_binaltquadtex: rep_binary_alterating_quad_texture $*
#@cli rep_binary_alterating_quad_texture: _variable_1>=0,_variable_2>=0,_variable_3>=0,_style={ 0 = Horizontal | 1 = Diagonal },0<=_operand<=2,0<=_angle<=360,_x_dir= { 0 = normal | 1 = inverted },_y_dir= { 0=normal | 1 = inverted }
#@cli : Generates a texture full of alternating quadrilateral shapes using binary logic. Converted, and extended from Asmageddon Quaddro Bumperoo/Inverto Paint.NET source code.
rep_binary_alterating_quad_texture:
skip ${5=2},${6=0},${7=0},${8=0}
channels 0 f "ang=pi*($6/180);sd=w/h;ix=((x/w)-.5)/(h>w?1/sd:1);iy=((y/h)-.5)/(w>h?sd:1);IX=ix*cos(ang)-iy*sin(ang);IY=ix*sin(ang)+iy*cos(ang);ix=IX;iy=IY;ix+=.5/(h>w?1/sd:1);iy+=.5/(w>h?sd:1);ix=(w>h?ix*w:ix*h);iy=(w>h?iy*w:iy*h);ix=round(ix)+1;iy=round(iy)+1;int(((($4==1?($5?($5==1?((($7?w-ix:ix)|int($1))+(($8?h-iy:iy)|int($2))):(xor(($7?w-ix:ix),int($1))+xor(($8?h-iy:iy),int($2)))):((($7?w-ix:ix)&int($1))+(($8?h-iy:iy)&int($2)))):($5?($5==1?((-($7?w-ix:ix)|int($1))+(-($8?h-iy:iy)|int($2))):(xor(-($7?w-ix:ix),int($1))+xor(-($8?h-iy:iy),int($2)))):((-($7?w-ix:ix)&int($1))+(-($8?h-iy:iy)&int($2)))))/(int($3)*2))-int(($4==1?($5?($5==1?((($7?w-ix:ix)|int($1))+(($8?h-iy:iy)|int($2))):(xor(($7?w-ix:ix),int($1))+xor(($8?h-iy:iy),int($2)))):((($7?w-ix:ix)&int($1))+(($8?h-iy:iy)&int($2)))):($5?($5==1?((-($7?w-ix:ix)|int($1))+(-($8?h-iy:iy)|int($2))):(xor(-($7?w-ix:ix),int($1))+xor(-($8?h-iy:iy),int($2)))):((-($7?w-ix:ix)&int($1))+(-($8?h-iy:iy)&int($2)))))/(int($3)*2)))*($4==1?($5?($5==1?((($7?w-ix:ix)|int($1))+(($8?h-iy:iy)|int($2))):(xor(($7?w-ix:ix),int($1))+xor(($8?h-iy:iy),int($2)))):((($7?w-ix:ix)&int($1))+(($8?h-iy:iy)&int($2)))):($5?($5==1?((-($7?w-ix:ix)|int($1))+(-($8?h-iy:iy)|int($2))):(xor(-($7?w-ix:ix),int($1))+xor(-($8?h-iy:iy),int($2)))):((-($7?w-ix:ix)&int($1))+(-($8?h-iy:iy)&int($2))))))<int($3)?($4==1?($5?($5==1?((($7?w-ix:ix)|int($1))+(-($8?h-iy:iy)|int($2))):(xor(($7?w-ix:ix),int($1))+xor(-($8?h-iy:iy),int($2)))):((($7?w-ix:ix)&int($1))+(-($8?h-iy:iy)&int($2)))):($5?($5==1?((($7?w-ix:ix)|int($1))+(($8?h-iy:iy)|int($2))):(xor(($7?w-ix:ix),int($1))+xor(($8?h-iy:iy),int($2)))):((($7?w-ix:ix)&int($1))+(($8?h-iy:iy)&int($2))))):($4==1?($5?($5==1?((-($7?w-ix:ix)|int($1))+(($8?h-iy:iy)|int($2))):(xor(-($7?w-ix:ix),int($1))+xor(($8?h-iy:iy),int($2)))):((-($7?w-ix:ix)&int($1))+(($8?h-iy:iy)&int($2)))):($5?($5==1?((-($7?w-ix:ix)|int($1))+(-($8?h-iy:iy)|int($2))):(xor(-($7?w-ix:ix),int($1))+xor(-($8?h-iy:iy),int($2)))):((-($7?w-ix:ix)&int($1))+(-($8?h-iy:iy)&int($2)))))"

#@gui Binary Alternating Quaddro Texture [Basic] : rep_binary_quaddro_basic_gui, rep_binary_quaddro_basic_gui_preview(1)
#@gui : note=note("This filter is a extended version of a filter found in<a href="https://forums.getpaint.net/topic/6845-asmageddon-tools-pack-v3/">Asmageddon Tools Pack v3</a>. Translated to G'MIC using a source code, and then extended. It is a mixture of two texture filters."),sep=separator()
#@gui : note=note("<b>Channel Processing</b>"),Texture Output=choice(0,"Grayscale","Hue","Degradation Mode"),sep=separator()
#@gui : note=note("<b>Main Texture Processing</b>")
#@gui : Variable#1=int(8,-512,512)
#@gui : Variable#2=int(8,-512,512)
#@gui : Variable#3=int(128,-200,200)
#@gui : Style=choice(0,"Bumping Alternating Texture","Alternating Glasses")
#@gui : Operand=choice(2,"AND","OR","XOR")
#@gui : Angle=float(0,-180,180)
#@gui : X-Flip=bool(0)
#@gui : Y-Flip=bool(0)
#@gui : Pre-Modulo=int(256,256,2048)
#@gui : Use Pre-Modulo?=bool(0)
#@gui : sep  = separator(), note = note("<small>Author : <i>Reptorian</i>      Latest update: <i>2018/12/19</i>.</small>")
rep_binary_quaddro_basic_gui:
if $1==0
rep_binaltquadtex ${2-9} if $11 % $10 fi % 256
elif $1==1
repeat $! l[$>] rep_binaltquadtex ${2-9} if $11 % $10 fi % 361 +f. 1 . a c hsv2rgb endl done
else
repeat $! l[$>] +rep_binaltquadtex ${2-9} n. 0,{h*w-1} f.. "I[i#1]" k.. endl done
fi
rep_binary_quaddro_basic_gui_preview:
rep_binary_quaddro_basic_gui $*

EDIT: Oh great, rotate doesn’t seem to have nearest interpolation…

I think that’s what “none” refers to actually, e.g. rotate. 45,0

Thanks. I found out that this isn’t the solution either. Looks like I’ll look for pixel art things. RotSprite algorithm is my biggest hope here.

EDIT: Didn’t work either. Ok, well, moving on…


The square graph might be my solution to the issue. To explain, I would have to use trigonometry just to find the length given angle to find the scaling factor.

I love these animations. Makes math fun. :sunny:

There’s this as well -

I’m not sure how easy this would be to replicate though.

Did you make these or lift them? :stuck_out_tongue:

Could also do both and even have the shapes morph. I would like to see you try. :slight_smile:

Can’t really try any time soon.

For now, I’m going to show a more teaser of what to come.

Teaser:

image

This is the result of a gui filter with extended version of asmageddon quaddro texture, and now I made another version where you can apply it to rgb to cmyk to xyz channels, and change between 8-bit values and not 8-bit value.

What’s coming is more than 10 new gui filter, and 10 new clis. Most GUI filter will indeed have dynamic options.

Also, I think @Joan_Rake1 will most certainly appreciate this.

1 Like

Me of want. Now. Will of extendings.

Also, about the second set of animations that have just been posted: they relate to how the waveforms shown in the first set of animations change as the shape itself rotates. In the case of using that square-tracing waveform, the parts of the waveform which aren’t straight lines are parts of a tangent graph, only with half of them flipped in accordance with the position in the waveform.

A bit closer here to release, but for now, only having a bit fun with the new gui filter I’m working on.

Hahaha! I’m enjoying the extended Asmageddon filters for g’mic I’m working on. A little too much to delay a day.


EDIT:
@Joan_Rake1 has asked to extend my binary quad series, so I won’t release those for early testing before g’mic community release. But, the rest is here for testing.

#@cli rep_sinowaterdist: (eq. to rep_sinusoidal_water_distortion)
rep_sinowaterdist: rep_sinusoidal_water_distortion $*
#@cli rep_sinusoidal_distortion: _xbalance>0,_ybalance>0,_scale>=0,_interpolation,_boundary_condition
#@cli : Shift by sinusoidal distortion formula.
rep_sinusoidal_water_distortion:
skip ${4=2},${5=1}
f
"
balanceY=y*sin(180)/$3*10;
balanceX=x*cos(180)/$3*10;
vx=x+cos(balanceY)*$1;
vy=y+sin(balanceX)*$2;
i(vx,vy,z,c,$4,($5?3:2));
"
#@cli rep_strbul: (eq. to rep_strange_bulger)
rep_strbul: rep_strange_bulger $*
#@cli rep_strange_bulger : 0<=_angle<=360,_axis={ 0 = X-Axis | 1 = Y-Axis },_interpolation,_boundary_condition
#@cli : Performs a bulge effect found in Strange Bulger Series made by Asmageddon for Paint.NET.
rep_strange_bulger:
f "
Ang=$1;
BulgeAng=Ang*(pi/180);
cX=w/2;
cY=h/2;
vx=$2?x:cX-x;
vy=$2?cY-y:y;
vx=(vx^2)/cX;
vy=(vy^2)/cY;
vx=(x+(x-vx)*cos(BulgeAng)+(y-vy)*sin(BulgeAng));
vy=(y+(x-vx)*sin(BulgeAng)+(y-vy)*cos(BulgeAng));
i(vx,vy,z,c,$3,($4?3:2));
"
#@cli rep_strbulkal: (eq. to rep_strange_bulge_kaleidoscope)
rep_strbulkal:rep_strange_bulge_kaleidoscope $*
#@cli rep_strange_bulge_kaleidoscope:0<=_bulge_ang<=360,_axis_of_bulge= { 0=horizontal | 1=vertical },_scale>0,-1<_offset_main_x<=1,-1<_offset_main_y<=1,-1<_offset_kaleido_x<=1,-1<_offset_kaleido_y,0<=Surface_Ang<=360,_mirror_placement= { 0=inside-out | 1=outside-in },_boundary_condition= { 0=Periodic | 1=Mirror },1<=_interpolation<=5,_dimension_reference>0
#@cli:_dimension_reference refers to the base dimension used for calculation of bulging, it uses the biggest dimension as a reference for scaling. The PDN version of Strange Bulger Kaleidoscope does not have a dimension reference which means that bulges are dependent on the image size. This is to ensure that preview stays consistent with the end result. What you see is what you get as _dimension_reference variable is a internal dimension processing variable.
rep_strange_bulge_kaleidoscope:
skip ${4=0},${5=0},${6=0},${7=0},${8=0},${9=0},${10=0},${11=3},${12=1024}
if $3<10^-8 v + error "Scale cannot be 0 or less than 0!" v - fi
if $12==0 v + error "dimension_reference cannot be 0!" v - fi

shift {50*$4}%,{50*$5}%,0,0,3,1

f "
BulgeAng=pi*((h>w?360-$1:$1)/180);
ang=pi*($8/180);
sd=w/h;
ox=$6;
oy=$7*-1;
ox/=h>w?1/sd:1;
oy/=w>h?sd:1;
OX=ox*cos(ang)-oy*sin(ang);
OY=ox*sin(ang)+oy*cos(ang);
ox=OX;
oy=OY;
ed=abs(int($12));
ix=((x/w)-.5)/(h>w?1/sd:1);
iy=((y/h)-.5)/(w>h?sd:1);
IX=ix*cos(ang)-iy*sin(ang);
IY=ix*sin(ang)+iy*cos(ang);
ix=IX;
iy=IY;
ix+=.5/(h>w?1/sd:1);
iy+=.5/(w>h?sd:1);
id=w>h?ed/w:ed/h;
iw=w*id;
ih=h*id;
ix*=ed;
iy*=ed;
cx=iw/2;
cy=ih/2;
xx=sqrt(abs(ix-cx-ox*(cx>cy?cx:cy)));
yy=sqrt(abs(iy-cy-oy*(cx>cy?cx:cy)));
xx*=$3*ed;
yy*=$3*ed;
xx/=100;
yy/=100;
vx=(w>h?$2:!$2)?xx:cx-xx;
vy=(w>h?$2:!$2)?cy-yy:yy;
vx=vx^2/cx;
vy=vy^2/cy;
vx=(xx+(xx-vx)*cos(BulgeAng)+(yy-vy)*sin(BulgeAng));
vy=(yy+(xx-vx)*sin(BulgeAng)+(yy-vy)*cos(BulgeAng));
vx*=w/ed;
vy*=h/ed;
i(vx,vy,z,c,$11,($10?3:2));
"
if $9 shift 50%,50%,0,0,3,1 fi
#@cli rep_logpindis: (eq. to rep_logarithmic_pinching_distortion)
rep_logpindis: rep_logarithmic_pinching_distortion $*
#@cli rep_logarithmic_pinching_distortion: _distortion_main>=0,-1<=_preshift_x<=1,-1<=_preshift_y<=1,-1<=_effposition_x<=1,-1<=_effposition_y<=1,_prescale_x,_prescale_y,_afterscale_x,_afterscale_y,0<=_angle<=360,_mirror_placement= { 0=outside-in | 1=inside-out },_lx_axis= { 0=different axis | 1=same axis},_ly_axis= { 0=different axis | 1=same axis},ix_dir={ 0=negative | 1=positive },iy_dir={ 0=negative | 1=positive },_boundary= { 0=Periodic | 1=Mirror },1<=_interpolation<=5,_dimension_ref>0
rep_logarithmic_pinching_distortion:
skip ${2=0},${3=0},${4=0},${5=0},${6=1},${7=1},${8=1},${9=1},${10=0},${11=0},${12=1},${13=0},${14=1},${15=0},${16=0},${17=5},${18=1024}
if $6==0||$7==0||$8==0||$9==0 v + error "Scale cannot be 0!" v - fi
if $17<1 v + error "interpolation cannot be less than 1" v - fi

shift {50*$2}%,{50*$3}%,0,0,3,1
f "
sd=w/h;
ang=pi*($10/180);
ox=$4*-1;
oy=$5;
ox/=h>w?1/sd:1;
oy/=w>h?sd:1;
OX=ox*cos(ang)-oy*sin(ang);
OY=ox*sin(ang)+oy*cos(ang);
ox=OX;
oy=OY;
ix=((x/w)-.5)/(h>w?1/sd:1);
iy=((y/h)-.5)/(w>h?sd:1);
IX=ix*cos(ang)-iy*sin(ang);
IY=ix*sin(ang)+iy*cos(ang);
ix=IX;
iy=IY;
ix=abs(ix+ox/2)*$6;
iy=abs(iy+oy/2)*$7;
ed=int(abs($18));
ed/=2;
ix*=ed;
iy*=ed;
lx=ix==0||iy==0?log(10^-8)*$1:log($12?iy^2:ix*iy)*$1;
ly=iy==0||iy==0?log(10^-8)*$1:log($13?ix^2:ix*iy)*$1;
dx=($14?1:-1);
dy=($15?1:-1);
ix-=lx*dx;
iy-=ly*dy;
ix*=w/ed;
iy*=h/ed;
ix*=$8;
iy*=$9;
i(ix,iy,z,c,$17,($16?3:2));
"
if $11 shift 50%,50%,0,0,3,1 fi
#@cli rep_sqrlogpindis: (eq. to rep_square_root_logarithmic_pinching_distortion)
rep_sqrlogpindis: rep_square_root_logarithmic_pinching_distortion $*
#@cli rep_square_root_logarithmic_pinching_distortion: _distortion_main>=0,-1<=_preshift_x<=1,-1<=_preshift_y<=1,-1<=_effposition_x<=1,-1<=_effposition_y<=1,_prescale_x,_prescale_y,_afterscale_x,_afterscale_y,0<=_angle<=360,_mirror_placement= { 0=outside-in | 1=inside-out },_lx_axis= { 0=different axis | 1=same axis},_ly_axis= { 0=different axis | 1=same axis},ix_dir={ 0=negative | 1=positive },iy_dir={ 0=negative | 1=positive },_boundary= { 0=Periodic | 1=Mirror },1<=_interpolation<=5,_dimension_ref>0
rep_square_root_logarithmic_pinching_distortion:
skip ${2=0},${3=0},${4=0},${5=0},${6=1},${7=1},${8=1},${9=1},${10=0},${11=0},${12=1},${13=0},${14=1},${15=0},${16=0},${17=5},${18=1024}
if $6==0||$7==0||$8==0||$9==0 v + error "Scale cannot be 0!" v - fi
if $17<1 v + error "interpolation cannot be less than 1" v - fi

shift {50*$2}%,{50*$3}%,0,0,3,1

f "ed=int(abs($18));
sd=w/h;
ang=pi*($10/180);
ox=$4;
oy=$5*-1;
ox/=h>w?1/sd:1;
oy/=w>h?sd:1;
OX=ox*cos(ang)-oy*sin(ang);
OY=ox*sin(ang)+oy*cos(ang);
ox=OX;
oy=OY;
ix=((x/w)-.5)/(h>w?1/sd:1);
iy=((y/h)-.5)/(w>h?sd:1);
IX=ix*cos(ang)-iy*sin(ang);
IY=ix*sin(ang)+iy*cos(ang);
ix=IX;
iy=IY;
ix+=.5/(h>w?1/sd:1);
iy+=.5/(w>h?sd:1);
iw=w/(h>w||w==h?1/sd:1);
ih=h/(w>h||w==h?1:1/sd);
id=ed/w;
iw*=id;
ih*=id;
cx=iw/2;
cy=ih/2;
ix*=1;
iy*=1;
xx=sqrt(abs(ix*ed-cx-cx*ox))*$6;
yy=sqrt(abs(iy*ed-cy-cx*oy))*$7;
vx=xx*100;
vy=yy*100;
lx=xx==0||yy==0?log(10^-8)*$1:log($12?yy^2:xx*yy)*$1;
ly=xx==0||yy==0?log(10^-8)*$1:log($13?xx^2:xx*yy)*$1;
vx+=($14?-1:1)*lx;
vy+=($15?-1:1)*ly;
vx*=w/ed;
vy*=h/ed;
vx*=$8;
vy*=$9;
i(vx,vy,z,c,$17,($16?3:2));
"

if $11 shift 50%,50%,0,0,3,1 fi

#@gui Sinusoidal Water Distortion : rep_sinowaterdist,rep_sinowaterdist_preview(0)
#@gui : X-Balance = float(0,-100,100)
#@gui : Y-Balance = float(0,-100,100)
#@gui : Scale = float(1,.1,20)
#@gui : Interpolation = choice(0,"Nearest","Linear","Bicubic")
#@gui : Boundary Condition = choice(0,"Periodic","Mirror")
#@gui :  sep  = separator(), Preview Type = choice("Full","Forward Horizontal","Forward Vertical","Backward Horizontal","Backward Vertical","Duplicate Top","Duplicate Left","Duplicate Bottom","Duplicate Right","Duplicate Horizontal","Duplicate Vertical","Checkered","Checkered Inverse"), Preview Split = point(50,50,0,0,200,200,200,0,10)_0
#@gui :  sep  = separator(), note = note("<small>Author: Reptorian.      Latest Update: <i>2019/6/4</i>.</small>")
rep_sinowaterdist_preview:
gui_split_preview "rep_sinowaterdist $*",${-3--1}
#@gui Strange Bulger : rep_strbul,rep_strbul_preview(0)
#@gui : Angle = float(0,-180,180)
#@gui : Axis = choice(0,"X-Axis","Y-Axis")
#@gui : Interpolation = choice(0,"Nearest","Linear","Bicubic")
#@gui : Boundary Condition = choice(0,"Periodic","Mirror")
#@gui :  sep  = separator(), Preview Type = choice("Full","Forward Horizontal","Forward Vertical","Backward Horizontal","Backward Vertical","Duplicate Top","Duplicate Left","Duplicate Bottom","Duplicate Right","Duplicate Horizontal","Duplicate Vertical","Checkered","Checkered Inverse"), Preview Split = point(50,50,0,0,200,200,200,0,10)_0
#@gui :  sep  = separator(), note = note("<small>Author: Reptorian.      Latest Update: <i>2019/6/4</i>.</small>")
rep_strbul_preview:
gui_split_preview "rep_strbul $*",${-3--1}
#@gui Strange Bulger Kaleidoscope: rep_strbulkal_gui, rep_strbulkal_gui_preview(0)
#@gui : note = note("This filter is a extended version of the filters named 'Strange Bulger A', and 'Strange Bulger B' found in<a href="https://forums.getpaint.net/topic/6845-asmageddon-tools-pack-v3/">Asmageddon Tools Pack v3</a>. Translated to G'MIC using source code for Asmageddon's tool, and then extended."),sep=separator()
#@gui : Bulge Angle = float(0,-180,180)
#@gui : Axis of Bulge = choice(0,"X-Axis","Y-Axis")
#@gui : Scale = float(1,.1,10)
#@gui : Preliminary Surface Shift = point(50,50,0,1,128,128,128,255)
#@gui : Distortion Surface Position = point(50,50,0,1,255,255,255,255)
#@gui : Distortion Surface Angle = float(0,0,360)
#@gui : Placement = choice(0,"Inside-Out","Outside-In")
#@gui : Boundary Condition = choice(0,"Periodic","Mirror")
#@gui : Interpolation = choice(2,"Nearest","Linear","Bicubic")
#@gui : Base Reference Dimension = int(1024,10,4096)
#@gui :  sep  = separator(), Preview Type = choice("Full","Forward Horizontal","Forward Vertical","Backward Horizontal","Backward Vertical","Duplicate Top","Duplicate Left","Duplicate Bottom","Duplicate Right","Duplicate Horizontal","Duplicate Vertical","Checkered","Checkered Inverse"), Preview Split = point(50,50,0,0,200,200,200,0,10)_0
#@gui :  sep  = separator(), note = note("<small>Author: Reptorian.      Latest Update: <i>2019/6/4</i>.</small>")
rep_strbulkal_gui:
rep_strbulkal ${1-3},{(($4/100)-.5)*2},{(($5/100)-.5)*-2},{(($6/100)-.5)*2},{(($7/100)-.5)*-2},${8-12}
rep_strbulkal_gui_preview:
gui_split_preview "rep_strbulkal_gui $*",${-3--1}
#@gui Logarithmic Distortion: rep_logpindis_gui, rep_logpindis_gui_preview(0)
#@gui : Distortion Factor = float(1,.1,1000)
#@gui : Preliminary Surface Shift = point(50,50,0,1,128,128,128,255)
#@gui : Distortion Surface Position = point(50,50,0,1,255,255,255,255)
#@gui : Preliminary X-Axis Scaling = float(1,.1,10)
#@gui : Preliminary Y-Axis Scaling = float(1,.1,10)
#@gui : Effect X-Axis Scaling = float(1,.1,10)
#@gui : Effect Y-Axis Scaling = float(1,.1,10)
#@gui : Distortion Surface Angle = float(0,0,360)
#@gui : Placement = choice(0,"Inside-Out","Outside-In")
#@gui : Logarithmic Distortion Axis Combination for X-Axis = choice(0,"Different Axis","Same Axis")
#@gui : Logarithmic Distortion Axis combination for y-Axis = choice(0,"Different Axis","Same Axis")
#@gui : Logarithmic Distortion X-Axis Direction = choice(0,"Negative","Positive")
#@gui : Logarithmic Distortion Y-Axis Direction = choice(0,"Negative","Positive")
#@gui : Boundary Condition = choice(0,"Periodic","Mirror")
#@gui : Interpolation = choice(2,"Nearest","Linear","Bicubic")
#@gui : Base Reference Dimension = int(1024,10,4096)
#@gui :  sep  = separator(), Preview Type = choice("Full","Forward Horizontal","Forward Vertical","Backward Horizontal","Backward Vertical","Duplicate Top","Duplicate Left","Duplicate Bottom","Duplicate Right","Duplicate Horizontal","Duplicate Vertical","Checkered","Checkered Inverse"), Preview Split = point(50,50,0,0,200,200,200,0,10)_0
#@gui :  sep  = separator(), note = note("<small>Author: Reptorian.      Latest Update: <i>2019/6/4</i>.</small>")
rep_logpindis_gui:
rep_logpindis $1,{(($2/100)-.5)*2},{(($3/100)-.5)*-2},{(($4/100)-.5)*2},{(($5/100)-.5)*-2},${6-18}
rep_logpindis_gui_preview:
gui_split_preview "rep_logpindis_gui $*",${-3--1}
#@gui Squareroot - Logarithmic Distortion: rep_sqrlogpindis_gui, rep_sqrlogpindis_gui_preview(0)
#@gui : Distortion Factor = float(1,.1,1000)
#@gui : Preliminary Surface Shift = point(50,50,0,1,128,128,128,255)
#@gui : Distortion Surface Position = point(50,50,0,1,255,255,255,255)
#@gui : Preliminary X-Axis Scaling = float(1,.1,10)
#@gui : Preliminary Y-Axis Scaling = float(1,.1,10)
#@gui : Effect X-Axis Scaling = float(1,.1,10)
#@gui : Effect Y-Axis Scaling = float(1,.1,10)
#@gui : Distortion Surface Angle = float(0,0,360)
#@gui : Placement = choice(0,"Inside-Out","Outside-In")
#@gui : Logarithmic Distortion Axis Combination for X-Axis = choice(0,"Different Axis","Same Axis")
#@gui : Logarithmic Distortion Axis combination for y-Axis = choice(0,"Different Axis","Same Axis")
#@gui : Logarithmic Distortion X-Axis Direction = choice(0,"Negative","Positive")
#@gui : Logarithmic Distortion Y-Axis Direction = choice(0,"Negative","Positive")
#@gui : Boundary Condition = choice(0,"Periodic","Mirror")
#@gui : Interpolation = choice(2,"Nearest","Linear","Bicubic")
#@gui : Base Reference Dimension = int(1024,10,4096)
#@gui :  sep  = separator(), Preview Type = choice("Full","Forward Horizontal","Forward Vertical","Backward Horizontal","Backward Vertical","Duplicate Top","Duplicate Left","Duplicate Bottom","Duplicate Right","Duplicate Horizontal","Duplicate Vertical","Checkered","Checkered Inverse"), Preview Split = point(50,50,0,0,200,200,200,0,10)_0
#@gui :  sep  = separator(), note = note("<small>Author: Reptorian.      Latest Update: <i>2019/6/4</i>.</small>")
rep_sqrlogpindis_gui:
rep_sqrlogpindis $1,{(($2/100)-.5)*2},{(($3/100)-.5)*-2},{(($4/100)-.5)*2},{(($5/100)-.5)*-2},${6-18}
rep_sqrlogpindis_gui_preview:
gui_split_preview "rep_sqrlogpindis_gui $*",${-3--1}

I might need better names for what they do, I"ll admit that. After a few day, and all goes well for testers or well, non-testers, I’ll put it right up on gmic community.

1 Like

You’ve already extended those texture scripts enough, my only suggestion was that you used sh for each channel instead of splitting the channels into different images altogether so that the commands would take less time to run. The log distortion thing also crashes the GIMP plugin for some reason. I don’t know where the debug output goes on Windows when it’s set to go to a file, so I can’t yet help with that.

I’m not sure how to get shared to work for each channel. As for the log distortion, does it crash when it starts up?

GIMP - Crashed
Krita 4.2 - Works fine
CLI - ?

@afre Does it work on CLI?

EDIT:
Got it -

sh[0] 3,3
sh[0] 2,2
rep_binaltquad.. 8,8,128,1
rep_binaltquad. 4,4,180,0

rm[^0]

Now I’m a bit more comfortable to use shared.