Reptorian G'MIC Filters


#43

It is up to you how many channels you would like to support. Note that G’MIC doesn’t care about the opacity, or alpha, channel. To it, that is just another channel among other channels. I.e., all split_opacity does is separate the last channel from the image. So, if you are working on a multispectral image of say 9 bands, the 9th channel would be separated.

It is tricky when you have 3-5 possible channels in Krita. I don’t know how Krita works. Does it store values as RGB, LAB, RGBA, LABA, CMYK or CMYKA? What ranges are the channels? 0-255, 0-65535 or 0-1? Are the alphas in the same range? As you can see, your filter needs to take into account all of these scenarios, or at least the more likely cases.

Lastly, chan_afre doesn’t need to use Boolean values. The channel value doubles as the 1, so like in my example, chan_afre 3,5,0 actually means chan_afre 1,1,0 and selects the channels rgb_r and rgb_b. Hence in the GUI, all you would need to do is include a number of Channel = choice(...)s according to the number of inputs you anticipate the user to require.


#44

Krita support LABA, CMYKA, RGBA, XYZ, GA with 4 different bit depth and format which are 8I, 16I, 16F, 32F . I is integer, and F is float. I just use n 0,255 as it works though I would like my filter to use 32F output as a option.

If I were to use choice, I’d be making 6 choices for each 3 main channels color space. 2 * 3 * 13=78. The cardinal of binary characters is 2.


#45

I’m working on this idea. Just thought that it might be interesting for texture generator to use something like this.

#@gui Channel Cloud: _channel_cloud, _channel_cloud_preview(0)
#@gui : note = note("This filter is basically the regular cloud with the addition of being able to set blending mode, and work with multiple channels at once.")
#@gui : Colour Space = choice("RGB/RGB8", "HSI/HSI8", "HSL/HSL8", "HSV/HSV8", "LAB/LAB8", "LCH/LCH8", "YCbCr/YCbCr-Glic", "YUV/YUV8", "YIQ/YIQ8", "XYZ/XYZ8")
#@gui : Alt Choice? = bool(0)
#@gui : sep = separator(), note = note("<b>Master Configuration</b>")
#@gui : Manipulate multiple channels at once? = bool(0)
#@gui : Process Channel 1? = bool(1)
#@gui : Process Channel 2? = bool(1)
#@gui : Process Channel 3? = bool(1)
#@gui : Process Alpha Channel? = bool(1)
#@gui : Use Colour Space Grayscale Blending? = bool(1)
#@gui : Colour Space Blending = choice("")
#@gui : Use Final Grayscale Blending? = bool(1)
#@gui : Final Grayscale Blending = choice("")
#@gui : sep = separator(), note = note("<b>Master Editor</b>")
#@gui : Replace Channel with black background? = bool(0)
#@gui : Iterations = int(1,1,20)
#@gui : Density per iterations
#@gui : Smoothness per iterations
#@gui : Channel Blending Mode = choice("")
#@gui : sep = separator(), note = note("<b>Individual Channel Editors</b>")
#@gui : note = note("<i>Channel#1</i>")
#@gui : Replace Channel with black background? = bool(0)
#@gui : Iterations = int(1,1,20)
#@gui : Density per iterations
#@gui : Smoothness per iterations
#@gui : Channel Blending Mode = choice("")
#@gui : sep = separator(), note = note("<i>Channel#2</i>")
#@gui : Replace Channel with black background? = bool(0)
#@gui : Iterations = int(1,1,20)
#@gui : Density per iterations
#@gui : Smoothness per iterations
#@gui : Channel Blending Mode = choice("")
#@gui : sep = separator(), note = note("<i>Channel#3</i>")
#@gui : Replace Channel with black background? = bool(0)
#@gui : Iterations = int(1,1,20)
#@gui : Density per iterations
#@gui : Smoothness per iterations
#@gui : Channel Blending Mode = choice("")
#@gui : sep = separator(), note = note("<i>Alpha Channel</i>")
#@gui : Replace Channel with black background? = bool(0)
#@gui : Iterations = int(1,1,20)
#@gui : Density per iterations
#@gui : Smoothness per iterations
#@gui : Channel Blending Mode = choice("")

Also, I took note on the ranges so that the effects are correct regarding of color space

rgb2hsi/rgb2hsl/rgb2hsv
{
Channel #1 = 0,360 range
Channel #2 = 0,1 range
Channel #3 = 0,255 range
}

rgb2lab
{
Channel #1 = 0,100 range
Channel #2 = -100,100 range
Channel #3 = -100,100 range
}

rgb2lch
{
Channel #1 = 0,100 range
Channel #2 = 0,100 range
Channel #3 = -pi,pi range
}

rgb2xyz
{
Channel #1 = 0,1 range
Channel #2 = 0,1 range
Channel #3 = -pi,pi range
}

I believe those are correct.


#46

Careful about the ranges. Since G’MIC is “just math”, it doesn’t normalize them to convenient limits. It all depends on the input colours. I think the builtin commands would clip the out-of-range colours. Just keep that in mind. Maybe try some extreme values to see what I mean.


#47

I finished my OOBS filter and I fixed the issue with the previous version. Didn’t want to add blending modes to the filter as the main purpose is to use different blur, sharpen parameters over individual channels or all of the channel at once. The overblur, and overline filter came exactly from the PDN varient of those. You can make a new layer with the image you want to apply the OOBS to, and then use blending mode on that layer in your respective software.

#@gui Channel Overblur/Overline/Blur/Sharpen: fx_OOBS, _fx_OOBS_preview(0)
#@gui : sep = separator()
#@gui : 1. Color Space = choice("RGB&#47;sRGB","HSV&#47;HSV8","HSL&#47;HSL8","HSI&#47;HSI8","LCH&#47;LCH8","Lab&#47;Lab8","YCbCr&#47;YCbCrGLIC","YIQ&#47;YIQ8","YUV&#47;YUV8","XYZ&#47;XYZ8")
#@gui : 2. Alt Choice = bool(0)
#@gui : sep = separator()
#@gui : note = note("Configuration for OOBS filter")
#@gui : 3. Use Master Editor(Manipulate multiple channels at once?) = bool(1)
#@gui : 4. Edit Channel #1? = bool(1)
#@gui : 5. Edit Channel #2? = bool(1)
#@gui : 6. Edit Channel #3? = bool(1)
#@gui : 7. Edit Alpha Channel? = bool(0)
#@gui : sep = separator()
#@gui : note = note("<b>Master Editor</b>")
#@gui : 8. Overblur/Overline/Sharpen/Blur = choice ("Overblur","Overline","Blur","Sharpen")
#@gui : 9. Effect Factor = float (1,.1,100)
#@gui : 10. Multiplication Factor = float (1,.1,10)
#@gui : 11. Effect Opacity = float (100,.01,100)
#@gui : sep = separator(), note = note("<u>Individual Channels</u>"), sep = separator()
#@gui : note = note("<b>Channel #1</b>")
#@gui : 12. Overblur/Overline/Sharpen/Blur = choice ("Overblur","Overline","Blur","Sharpen")
#@gui : 13. Effect Factor = float (1,.1,10)
#@gui : 14. Multiplication Factor = float (1,.1,10)
#@gui : 15. Effect Opacity = float (100,.01,100)
#@gui : sep = separator()
#@gui : note = note("<b>Channel #2</b>")
#@gui : 16. Overblur/Overline/Sharpen/Blur = choice ("Overblur","Overline","Blur","Sharpen")
#@gui : 17. Effect Factor = float (1,.1,10)
#@gui : 18. Multiplication Factor = float (1,.1,10)
#@gui : 19. Effect Opacity = float (100,.01,100)
#@gui : sep = separator()
#@gui : note = note("<b>Channel #3</b>")
#@gui : 20. Overblur/Overline/Sharpen/Blur = choice ("Overblur","Overline","Blur","Sharpen")
#@gui : 21. Effect Factor = float (1,.1,10)
#@gui : 22. Multiplication Factor = float (1,.1,10)
#@gui : 23. Effect Opacity = float (100,.01,100)
#@gui : sep = separator()
#@gui : note = note("<b>Alpha Channel</b>")
#@gui : 24. Overblur/Overline/Sharpen/Blur = choice ("Overblur","Overline","Blur","Sharpen")
#@gui : 25. Effect Factor = float (1,.1,10)
#@gui : 26. Multiplication Factor = float (1,.1,10)
#@gui : 27. Effect Opacity = float (100,.01,100)
#@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")
#@gui : sep = separator(), note = note("<small>Author : <i>Reptorian</i>      Latest update: <i>2019/01/7</i>.</small>")

fx_OOBS:
split_opacity
local[0]
if {$2==0}
if ($1==1} rgb2hsv
elif ($1==2} rgb2hsl
elif ($1==3} rgb2hsi
elif ($1==4} rgb2lch
elif ($1==5} rgb2lab
elif ($1==6} rgb2ycbcr
elif ($1==7} rgb2yiq
elif ($1==8} rgb2yuv
elif ($1==9} rgb2xyz
fi
elif {$2==1}
if {$1==0} rgb2srgb
elif {$1==1} rgb2hsv8
elif {$1==2} rgb2hsl8
elif {$1==3} rgb2hsi8
elif {$1==4} rgb2lch8
elif {$1==5} rgb2lab8
elif {$1==6} rgb2ycbcrglic
elif {$1==7} rgb2yiq8
elif {$1==8} rgb2yuv8
elif {$1==9} rgb2xyz8
fi fi
s c
if {$3==1}
if {$4==1} local[0] +oobs_edit[0] $8,$9,$10 -blend[0,1] normal,$11/100 endl fi
if {$5==1} local[1] +oobs_edit[0] $8,$9,$10 -blend[0,1] normal,$11/100 endl fi
if {$6==1} local[2] +oobs_edit[0] $8,$9,$10 -blend[0,1] normal,$11/100 endl fi
elif {$3==0}
if {$4==1} local[0] +oobs_edit[0] $12,$13,$14 -blend[0,1] normal,$15/100 endl fi
if {$5==1} local[1] +oobs_edit[0] $16,$17,$18 -blend[0,1] normal,$19/100 endl fi
if {$6==1} local[2] +oobs_edit[0] $20,$21,$22 -blend[0,1] normal,$23/100 endl fi
fi
a c
if {$2==0}
if ($1==1} hsv2rgb
elif ($1==2} hsl2rgb
elif ($1==3} hsi2rgb
elif ($1==4} lch2rgb
elif ($1==5} lab2rgb
elif ($1==6} ycbcr2rgb
elif ($1==7} yiq2rgb
elif ($1==8} yuv2rgb
elif ($1==9} xyz2rgb
fi
elif {$2==1}
if {$1==0} srgb2rgb
elif {$1==1} hsv82rgb
elif {$1==2} hsl82rgb
elif {$1==3} hsi82rgb
elif {$1==4} lch82rgb
elif {$1==5} lab82rgb
elif {$1==6} ycbcrglic2rgb
elif {$1==7} yiq82rgb
elif {$1==8} yuv82rgb
elif {$1==9} xyz82rgb
fi fi
endl
local[1]
if {$3==1} +oobs_edit[0] $8,$9,$10 -blend[0,1] multiply,$11/100
elif {$3==0} +oobs_edit[0] $23,$24,$25 -blend[0,1] multiply,$26/100
fi
endl
a c

oobs_edit :
if {$1==0} -overblur_overline[0] 0,$2,$3 fi
if {$1==1} -overblur_overline[0] 1,$2,$3 fi
if {$1==2} -blur[0] {$2*$3} fi
if {$1==3} -sharpen[0] {$2*$3} fi

overblur_overline :
if {$1==0} +blur[0] $2
elif {$1==1} +sharpen[0] $2
fi
+blend[0,1] difference
mul[2] $3
remove[1]
-blend[0,1] add

_fx_OOBS_preview :
gui_split_preview "fx_OOBS ${1--2}",$-1

With the help of the OOBS filter

image

It’s really not that great of a filter, but maybe there will be a use of it. At least you can manipulate multiple channels at once and use overline or overblur instead. I do think it may actually have a place for manipulating fractal pictures. Not for generic editing. I might try to make it better by implementing blending mode, but I’ll do that later.


Also, made some more bugfixes on the Vibrato filter. I think this one actually works completely. I had forgotten $ placement in some areas. I removed the numbers as it’s complete.

#@gui Vibrato: fx_vibrato, _fx_vibrato_preview(0)
#@gui : note = note("This is the advanced version of the Vibrato filter. If you do want to manipulate multiple channels at once, use <u>Vibrato - Basic</u> filter. <i>Note: Disable channel mulplication for non-transparent images.</i> \n\n")
#@gui : note = note("This filter is the one of the G'MIC version of <b>MadJik's</b> <i>Paint.NET plugin</i>")
#@gui : sep = separator()
#@gui : Colour Space = choice("RGB", "CMY", "HSI", "HSL", "HSV", "LAB", "LCH", "YCbCr", "YCbCr-Glic", "YUV", "YIQ", "XYZ", "Bayer")
#@gui : sep = separator()
#@gui : Manipulate multiple channels at once? = bool(1)
#@gui : Process Channel 1? = bool(1)
#@gui : Process Channel 2? = bool(1)
#@gui : Process Channel 3? = bool(1)
#@gui : Process Alpha Channel? = bool(1)
#@gui : Inherit Alpha? = bool(1)
#@gui : X-Orientation = bool(1)
#@gui : Y-Orientation = bool(1)
#@gui : U- Factor = float(.85,.1,15)
#@gui : V- Factor = float(.85,.1,15)
#@gui : X-Scale Factor = float(1,.1,15)
#@gui : Y-Scale Factor = float(1,.1,15)
#@gui : XY-Scale Factor = float(1,.1,3)
#@gui : Percentage-Based X Pixel Shift = float(0,-200,200)
#@gui : Percentage-Based Y Pixel Shift = float(0,-200,200)
#@gui : Elevation = float(.7,-100,100)
#@gui : Multiply Blending = bool(0)
#@gui : Invert Vibrato = bool(0)
#@gui : Vibrato Blending Factor = float (100,0,100)
#@gui : Channel Influence Factor = float(1,-8,8)
#@gui : Final Channel Modulos Multiplication Factor = float(1,1,32)
#@gui : sep = separator()
#@gui : note = note("- <b>Channel #1</b> - ")
#@gui : Process Channel? = bool(1)
#@gui : X-Orientation = bool(1)
#@gui : Y-Orientation = bool(1)
#@gui : U-Factor = float(.85,.1,15)
#@gui : V-Factor = float(.85,.1,15)
#@gui : X-Scale Factor = float(1,.1,15)
#@gui : Y-Scale Factor = float(1,.1,15)
#@gui : XY-Scale Factor = float(1,.1,3)
#@gui : Percentage-Based X Pixel Shift = float(0,-200,200)
#@gui : Percentage-Based Y Pixel Shift = float(0,-200,200)
#@gui : Elevation = float(.7,-100,100)
#@gui : Multiply Blending = bool(0)
#@gui : Invert Vibrato = bool(0)
#@gui : Vibrato Blending Factor = float (100,0,100)
#@gui : Channel Influence Factor = float(1,-8,8)
#@gui : Final Channel Modulos Multiplication Factor = float(1,1,32)
#@gui : sep = separator()
#@gui : note = note("- <b>Channel #2</b> - ")
#@gui : Process Channel? = bool(1)
#@gui : X-Orientation = bool(1)
#@gui : Y-Orientation = bool(1)
#@gui : U-Factor = float(.85,.1,15)
#@gui : V-Factor = float(.85,.1,15)
#@gui : X-Scale Factor = float(1,.1,15)
#@gui : Y-Scale Factor = float(1,.1,15)
#@gui : XY-Scale Factor = float(1,.1,3)
#@gui : Percentage-Based X Pixel Shift = float(0,-200,200)
#@gui : Percentage-Based Y Pixel Shift = float(0,-200,200)
#@gui : Elevation = float(.7,-100,100)
#@gui : Multiply Blending = bool(0)
#@gui : Invert Vibrato = bool(0)
#@gui : Vibrato Blending Factor = float (100,0,100)
#@gui : Channel Influence Factor = float(1,-8,8)
#@gui : Final Channel Modulos Multiplication Factor = float(1,1,32)
#@gui : sep = separator()
#@gui : note = note("- <b>Channel #3</b> - ")
#@gui : Process Channel? = bool(1)
#@gui : X-Orientation = bool(1)
#@gui : Y-Orientation = bool(1)
#@gui : U-Factor = float(.85,.1,15)
#@gui : V-Factor = float(.85,.1,15)
#@gui : X-Scale Factor = float(1,.1,15)
#@gui : Y-Scale Factor = float(1,.1,15)
#@gui : XY-Scale Factor = float(1,.1,3)
#@gui : Percentage-Based X Pixel Shift = float(0,-200,200)
#@gui : Percentage-Based Y Pixel Shift = float(0,-200,200)
#@gui : Elevation = float(.7,-100,100)
#@gui : Multiply Blending = bool(0)
#@gui : Invert Vibrato = bool(0)
#@gui : Vibrato Blending Factor = float (100,0,100)
#@gui : Channel Influence Factor = float(1,-8,8)
#@gui : Final Channel Modulos Multiplication Factor = float(1,1,32)
#@gui : sep = separator()
#@gui : note = note("- <b>Alpha Channel #1</b> - ")
#@gui : Process Channel? = bool(0)
#@gui : X-Orientation = bool(1)
#@gui : Y-Orientation = bool(1)
#@gui : U-Factor = float(.85,.1,15)
#@gui : V-Factor = float(.85,.1,15)
#@gui : X-Scale Factor = float(1,.1,15)
#@gui : Y-Scale Factor = float(1,.1,15)
#@gui : XY-Scale Factor = float(1,.1,3)
#@gui : Percentage-Based X Pixel Shift = float(0,-200,200)
#@gui : Percentage-Based Y Pixel Shift = float(0,-200,200)
#@gui : Elevation = float(.7,-100,100)
#@gui : Multiply Blending = bool(1)
#@gui : Invert Vibrato = bool(0)
#@gui : Vibrato Blending Factor = float (100,0,100)
#@gui : Channel Influence Factor = float(1,-8,8)
#@gui : Final Channel Modulos Multiplication Factor = float(1,1,32)
#@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")
#@gui : sep = separator(), note = note("<small>Author : <i>Reptorian</i>      Latest update: <i>2018/12/19</i>.</small>")

fx_vibrato:
split_opacity
local[0]
if {$1==1} rgb2cmy
elif {$1==2} rgb2hsi8
elif {$1==3} rgb2hsl8
elif {$1==4} rgb2hsv8
elif {$1==5} rgb2lab8
elif {$1==6} rgb2lch8
elif {$1==7} rgb2ycbcr
elif {$1==8} rgb2ycbcrglic
elif {$1==9} rgb2yuv8
elif {$1==10} rgb2yiq8
elif {$1==11} rgb2xyz8
elif {$1==12} rgb2bayer 0
fi

s c

if {$2==1} 
if {$3==1} -vibrato[0] $8,$9,$10,$11,$12,$13,$14,$15,$16,$17,$18,$19,$20,$21,$22 fi
if {$4==1} -vibrato[1] $8,$9,$10,$11,$12,$13,$14,$15,$16,$17,$18,$19,$20,$21,$22 fi
if {$5==1} -vibrato[2] $8,$9,$10,$11,$12,$13,$14,$15,$16,$17,$18,$19,$20,$21,$22 fi
elif {$2==0} 
if {$23==1} -vibrato[0] $24,$25,$26,$27,$28,$29,$30,$31,$32,$33,$34,$35,$36,$37,$38 fi
if {$39==1} -vibrato[1] $40,$41,$42,$43,$44,$45,$46,$47,$48,$49,$50,$51,$52,$53,$54 fi
if {$55==1} -vibrato[2] $56,$57,$58,$59,$60,$61,$62,$63,$64,$65,$66,$67,$68,$69,$70 fi
fi
a c

if {$1==1} cmy2rgb
elif {$1==2} hsi82rgb
elif {$1==3} hsl82rgb
elif {$1==4} hsv82rgb
elif {$1==5} lab82rgb
elif {$1==6} lch82rgb
elif {$1==7} ycbcr2rgb
elif {$1==8} ycbcrglic2rgb
elif {$1==9} yuv82rgb
elif {$1==10} yiq82rgb
elif {$1==11} xyz82rgb
elif {$1==12} bayer2rgb 0,0,0
fi
endl
if {$2==1}
if {$6==1} -vibrato[1] $8,$9,$10,$11,$12,$13,$14,$15,$16,$17,$7,$19,$20,$21,$22 fi
elif {$2==0}
if {$71==1} -vibrato[1] $72,$73,$74,$75,$76,$77,$78,$79,$80,$81,$82,$83,$84,$85,$86 fi
fi
a c

vibrato:
repeat $! l[$>]
n 0,255 
f "
q=($8/100)*w;
l=($9/100)*h;
X=(($1?w-x+q:x+q)/w-.5) * 2 * 1/$5 * 1/$7;
Y=(($2?h-y+l:y+l)/h-.5) * 2 * 1/$6 * 1/$7;
U=sqrt($3);
V=sqrt($4);
Z=((X-Y) * (X-U) * (X+U) * (Y-V) * (Y+V))+ $10;
C=(Z+((1-i/255)/(($3>1?$3:1/$3)*($4>1?$4:1/$4)))*$14)*(Z+((1-i/255)/(($3>1?$3:1/$3)*($4>1?$4:1/$4)))*$14);
F=abs(C)>1?C-int(C):C;
A=$12?F:1-F;
B=$11?(i*A):A*200;
E=$13/100*B+(1-$13/100)*i;
" n 0,255 mul $15 mod 256
endl done

_fx_vibrato_preview :
gui_split_preview "fx_vibrato ${1--2}",$-1

New filter as of 1/9/2019

#@gui Emboss/Relief : fx_emboss_relief, fx_emboss_relief_preview(0)
#@gui : sep = separator()
#@gui : Smoothness = float(0,0,10)
#@gui : Emboss Angle = float(0,0,360)
#@gui : Level 1 Depth Boost = float(0,0,1)
#@gui : Level 2 Depth Boost = float(0,0,1)
#@gui : Preserve Alpha? = bool(1)
#@gui : sep = separator(), note = note("Relief Section")
#@gui : Apply relief? = bool(1)
#@gui : Blending Mode = choice(0,"Grain Extract","Grain Merge")
#@gui : Blending Opacity = float(1,0,1)
#@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/1/9</i>.</small>")

fx_emboss_relief :
if {$6==1} split_opacity 
+fx_emboss $1,$2,$3,$4,0 
if {$7==0} blend[0,2] grainextract,$8
elif {$7==1} blend[0,2] grainmerge,$8 fi
if {$5==0} rm[1]
elif {$5==1} a c fi
elif {$6==0} fx_emboss $1,$2,$3,$4,$5 fi

fx_emboss :
split_opacity
emboss_image[0] $1,$2,$3,$4
if {$5==0} rm[1]
elif {$5==1} a c fi

emboss_image :
luminance
fx_gradient2rgb $1,0,100,0,0
_hue_rotation $2
+_hue_rotation 180
_angle_result[0] 0
_angle_result[1] 1
+fill_color 127.5,127.5,127.5,255
blend grainmerge
[0]
blend grainmerge,$3
[0]
blend grainmerge,$4

_angle_result :
to_rgb
s c
rm[1,2]
if {$1==0} n 128,255
elif {$1==1} negate n 0,128 fi

_hue_rotation :
rgb2hsv s c
local[0]
f "H=$1;H+i-(floor((H+i)/360)*360)"
endl
a c
hsv2rgb

fx_emboss_relief_preview :
gui_split_preview "fx_emboss_relief $*",${-3--1}

Emboss Before/After

This is meant for texture artists. Also, Krita users now have a better embossing filter than the one in the program.

And here’s my first cli command

#@cli sol8: : eq. to 'solarize8'.
#@cli : Solarize image using 8-bit values
sol8 :
f "i>127.5?255-i:i" mul 2

EDIT: Combined relief and emboss into one filter.
Before/After -
image


#48

I would like to have some help here.

#@gui Construction Material Texture : _construction_material, _construction_material_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")
#@gui : sep = separator(), note = note("<b>Plasma Texture</b>")
#@gui : Background Color = color(0,0,0)
#@gui : Alpha = float(0.5,0,5)
#@gui : Beta = float(0,0,100)
#@gui : Scale = int(8,2,10)
#@gui : Randomize = bool(0)
#@gui : Color Balance = color(128,128,128)
#@gui : sep = separator(), note = note("<b>Quick Desaturate</b>")
#@gui : Desaturate? = bool(1)
#@gui : Colour Space = choice("RGB","sRGB")
#@gui : Channel 1 = float(1,0,3)
#@gui : Channel 2 = float(1,0,3)
#@gui : Channel 3 = float(1,0,3)
#@gui : Normalise = bool(1)
#@gui : sep = separator(), note = note("<b>Luminosity Restrictions</b>")
#@gui : Lower Bound = float(0,0,127)
#@gui : Higher Bound = float(255,128,255)
#@gui : Normalise = bool(1)
#@gui : sep = separator(), note = note("<b>Warp by Intensity</b>")
#@gui : X-Factor = float(0.04,-6,6)
#@gui : Y-Factor = float(0.04,-6,6)
#@gui : sep = separator()
#@gui : X-Offset = float(128,0,255)
#@gui : Y-Offset = float(128,0,255)
#@gui : sep = separator()
#@gui : Correlated Channels = bool(0)
#@gui : Interpolation = choice(1,"Nearest Neighbor","Linear")
#@gui : Boundary = choice(3,"Transparent","Nearest","Periodic","Mirror")
#@gui : sep = separator(), Channel(s) = choice("All","RGBA [All]","RGB [All]","RGB [Red]","RGB [Green]","RGB [Blue]","RGBA [Alpha]","Linear RGB [All]","Linear RGB [Red]","Linear RGB [Green]","Linear RGB [Blue]","YCbCr [Luminance]","YCbCr [Blue-Red Chrominances]","YCbCr [Blue Chrominance]","YCbCr [Red Chrominance]","YCbCr [Green Chrominance]","Lab [Lightness]","Lab [ab-Chrominances]","Lab [a-Chrominance]","Lab [b-Chrominance]","Lch [ch-Chrominances]","Lch [c-Chrominance]","Lch [h-Chrominance]","HSV [Hue]","HSV [Saturation]","HSV [Value]","HSI [Intensity]","HSL [Lightness]","CMYK [Cyan]","CMYK [Magenta]","CMYK [Yellow]","CMYK [Key]","YIQ [Luma]","YIQ [Chromas]")
#@gui : sep = separator(), note = note("<b>Relief Texture</b>")
#@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/1/9</i>.</small>")

_construction_material :
construction_material_base ${1-20}
fx_warp_by_intensity ${21-28}

construction_material_base : 
skip {$7==0},{$11==0},{$20==0}
fill_color $1,$2,$3
to_rgb
if $7 rand 0,255 fi
plasma ${4-6} n 0,255
balance_gamma ${8-10}
if $11 jr_desaturate ${12-17} fi
cut $18,$19
if $20 n 0,255 fi

_construction_material_preview :
gui_split_preview "_construction_material $*",${-3--1}

Can’t get the warp by intensity to work without making it look like garbage. I mean take out the warp by intensity, and apply it through G’MIC. And you’d see it wouldn’t like total crud. The reason for the separation is that I do not want to look like total crud.


(dumb) #49

For batch processing purposes you might want to use a repeat $! l[$>] ... endl done block in fx_emboss_relief. As for the concrete one, some of your variables were offset by 1. Now it should work fine. You also shouldn’t put the colour balancing after the desaturation because the former simply won’t have a noticeable effect unless one’s looking for an unusual multicoloured patchwork texture.

_construction_material :
construction_material_base ${1-19}
fx_warp_by_intensity ${20-27}

construction_material_base : 
skip {$7==0},{$11==0},{$19==0}
fill_color $1,$2,$3
to_rgb
if $7 rand 0,255 fi
plasma ${4-6} n 0,255
if $11 jr_desaturate ${12-16} fi
balance_gamma ${8-10}
cut $17,$18
if $19 n 0,255 fi

Note that I haven’t reordered the GUI parameters since I don’t know what you might come up with and it might beat anything I’d do there since my script are horribly complicated in some areas and lacking in others. Some other things that you might want to add would be a Butterworth bandpass module (or anything else that brings out details but I’ll continue to scream about my implementation) and an option to have partial desaturation. You should also consider adding in that relief script or using the Turbulence (fx_turbulence) script to generate more varied and precise textures without the artefacts at the edges that the plasma script has.


#50

You mean, you want me to add a way to loop the effect? I’m not so sure why since the purpose of the filter is to emulate a better version of emboss/relief filter from the PDN one.

And thanks for the fix. That’s something that has never came up to me since I thought it was working, and no error throws up. I will consider using turbulence instead. The relief script will come last as the main thing I need to get is the look of concrete before relief has been applied.


(dumb) #51

You mean, you want me to add a way to loop the effect? I’m not so sure why since the purpose of the filter is to emulate a better version of emboss/relief filter from the PDN one.

The repeat $! l[$>] ... endl done repeats the enclosed commands once for every image in the list of images but separates each image using the local command. In other words, it forces G’MIC to treat them all separately by using the iteration number of the repeat loop for the image selector in that local command, which is useful when performing operations which require additional image specific to each input image. It won’t run the commands on the same image twice unless you make it select images more than once through the selections overlapping.

If there’s any images which must be processed in common between all images, it’ll have to be included in the l[...] command along with the image range that one wants to process separately from the others. Images added in the l[...] block will also remain unless one uses rm or k (though I’m not sure about what happens to shared images).

And thanks for the fix. That’s something that has never came up to me since I thought it was working, and no error throws up.

You’ll probably run into this mistake again just as I have done many times over, but a way to pinpoint it is to see what each of the parameters are doing. The warping was behaving unusually before the fix where the X-factor parameter was actually controlling the Y-factor!

The relief script will come last as the main thing I need to get is the look of concrete before relief has been applied.

I should’ve been clearer about this: the relief effect contributes to the ‘look of concrete’ itself. In the PDN script one can see shadows, for example. Applying it on fine details might give it a better look, and if it does you should get the details command to work on the original and the embossed version first before merging them. You should use +fx_emboss_relief to get a new image that’s an embossed copy of the old one.

Edit: did some experimentation and I’m being a complete idiot. Using something like ‘freaky details’ will bring out the details on an ordinary concrete texture, getting one from this…

image

…to this…

image

…but adding a lowpassed copy of the original image (low frequency and order), embossing that copy, blurring the original very slightly and then grain merging can make a great Venusian-ish texture.

image

Another edit: the turbulence script isn’t very good at generating grainy noise so add some noise thing in for that. Also, cut can take a larger value before a smaller one.


(Karsten R) #53

Maybe, you should add the line

_solarize : sol

#@cli … is never a definition!


#60

Solved the lab editing issue on Transfer Colors [Reduced Colors] filter. A pull request was done almost at the same time this post was made.


An idea for a filter - https://m.imgur.com/gallery/gP0lecI

Might be glitch filter though.


#61

This is quite simple to figure out. A good exercise for you. I think there are a few examples in the stdlib of sorting and mixing split images.


#62

I’ll look for the stdlib when I get the chance after 2/13. I just learned how to create a palette of colors, so I might be able to improve on the transfer color reduced color filter by adding premade palette that defines existing color palette. I’m interested in only ones viable for pixel art.


105 palettes total into my transfer color filter! I will put it at least 10 more palettes to finish up, and create a new filter which generate those pre-existing palette for pixel artists out there.


#63

You are so prolific! :+1:


#64

I added something to my pre-made palette filter -

Should I have added those information and their source which is lospec for the most part? Pixelwave from lospec isn’t quite good, so I had to make one for myself and replaced that with my own.

Also, in case you’re wondering about Blend into Image, that’s for PDN support as they can’t support newly generated layers from filters. It wouldn’t be there if it did.

Another info - 134 palette for G’MIC.


#65

Up to you what info you would like to include. From the screenshot, I do appreciate the inclusion of the credits for each of the palettes. Very informative: more filter devs should do that.


(dumb) #66

Also it would be much more useful for the input box to go above the palette information notes.


#67

I can’t do anything about input/output mode. That’s already something that is part of almost every single filter excluding code[local] and they stay below those filters. If you’re talking about scale factor, palette to choose, and whether to blend image. It’s already above palette info.


#68

I’m almost finished with the idea of the filter I wanted. I just need a name.

Names

  1. Pasta Maker Sampling
  2. Stripe Reordering Sampling
  3. Alternating Stripe Sampling

Those I can think of.

Also, hilarious command names for those when I noticed what the initials would be.

There’s one more I thought of, and it is alternating stripe cut-out.

None of those are descriptive of the effect.


Here’s the effect

 #@gui Alternating Stripe-Cutout Reordering: alt_stripecut_reorder,alt_stripecut_reorder_preview(0)
 #@gui : note = note("This filter is inspired by a method to divide images with a pasta maker, and do a simple subsampling. Not even sure if that's accurate or this name is accurate."),sep = separator()
 #@gui : Amount of cut-out = int(8,4,64)
 #@gui : Line Cutout Direction = choice(0,"Vertical","Horizontal")
 #@gui : End Connectin Direction = choice(0,"Vertical","Horizontal")
 #@gui : Reverse Ordering? = bool(0)
 alt_stripecut_reorder: if $2 s x,$1 repeat {$1/2-1} a[0,{$>+2}] x done a[^0] x if $4 rv fi if $3 a x else a y fi else  $2 s y,$1 repeat {$1/2-1} a[0,{$>+2}] y done a[^0] y if $4 rv fi if $3 a x else a y fi fi
 alt_stripecut_reorder_preview: alt_stripecut_reorder $*

Using a person that does not exist


#69

She’s so cute, with those bubbly eyes. Imagine interpolating the squares into a more sensible face. Actually, I think it is already being done.

I cannot think of better names right now; but I know there are at least two suitable terms for this kind of manipulation or style.