Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #@gui Mesh blend : fx_mesh_blend, fx_mesh_blend_preview()
- #@gui : note = note("Universal blending algorithm. Resizes an RGBA image to a 256x256 image and uses it as an RGBA LUT 'transfer function mesh' to blend two other images together. Based on method shown <a href="https://discuss.pixls.us/t/im-generating-new-blending-modes-for-krita/8104/16">on discuss.pixls.us</a>.")
- #@gui : sep = separator(), note = note("<small>[0] is bottom layer, [1] is top layer, [2] is mesh. Final blended image has dimensions of bottom layer. Plugin GUI preview does not accurately show mesh.</small>")
- #@gui : Process as = choice(0,"Three-by-three","Self-mesh and self-blend for each layer")
- #@gui : Resize interpolation = choice(2,"Nearest","Average","Bilinear","Grid","Bicubic")
- #@gui : Reverse blending layers = bool(0)
- #@gui : Dimensions = choice("Bottom layer","Top layer")
- #@gui : Alpha = bool(0)
- #@gui : Keep mesh = bool(0)
- _fx_mesh_blend :
- r. 256,256,100%,100%,{1+$1}
- if $4 to_rgba else to_rgb fi
- if $2 rv[0,1] fi
- f[$3] "i(#2,255-[i(#0),i(#1)])"
- if {!$5} rm[2] fi
- if $3 rm[0] else rm[1] fi
- fx_mesh_blend :
- if {$1==0} repeat {int($!/3)} l[$>-{$>+2}] rv _fx_mesh_blend ${2-6} endl done
- elif {$1==1} repeat $! l[$>] [0]x2 _fx_mesh_blend ${2-6} endl done fi
- fx_mesh_blend_preview :
- fx_mesh_blend $*
- #@gui Bomb blend : fx_blend_bomb, fx_blend_bomb_preview()
- #@gui : note = note("Creates a random transfer function 'mesh' and then blends images accordingly. Based on method shown <a href="https://discuss.pixls.us/t/im-generating-new-blending-modes-for-krita/8104/16">on discuss.pixls.us</a>.")
- #@gui : Recompute = button(0)
- #@gui : Process as = choice(1,"Two-by-two","Self-blend for each layer")
- #@gui : Mesh X = int(16,1,256)
- #@gui : Mesh Y = int(16,1,256)
- #@gui : Mesh smoothness = float(2,0,10)
- #@gui : Contrast scheme = choice("Arctan","Clip")
- #@gui : Mesh contrast = float(50,0,100)
- #@gui : Reverse blending layers = bool(0)
- #@gui : Dimensions = choice("Bottom layer","Top layer")
- #@gui : Alpha = bool(0)
- #@gui : Normalise = bool(0)
- #@gui : Output mesh = bool(0)
- _fx_blend_bomb :
- to_rgba
- $1,$2,1,4 noise. 255
- if $8 ac. "noise 255",rgba_a fi
- r. 256,256 n. 0,255 blur. {$3^2}%
- l. if {$4==0}
- * {1/255} f "i-0.5+(atan((i-0.5)*($5/10)^3)/pi)+0.5" * 255 n 0,255
- elif {$4==1}
- c {($5-1/255)/2}%,{100-($5-1/255)/2}% n 0,255
- fi endl
- rv
- fx_mesh_blend 0,0,$6,$7,$8,$10
- if $9 ac "n 0,255",rgba fi
- fx_blend_bomb :
- if {$2==0} repeat {int($!/2)} l[$>,{$>+1}] _fx_blend_bomb ${3-12} endl done
- elif {$2==1} repeat $! l[$>] [0] _fx_blend_bomb ${3-12} endl done fi
- fx_blend_bomb_preview :
- fx_blend_bomb $*
- #@gui JIFF [JPEG] self-bomb : fx_jiff_bomb, fx_jiff_bomb_preview()
- #@gui : note = note("OI! TRY SMOOTHING THIS!")
- #@gui : note = note("<small>Adds JPEG artefacts and then self-bomb-blends.</small>")
- #@gui : Recompute = button(0)
- #@gui : Quality (%) = int(50,1,100)
- #@gui : Mesh X = float(16,1,256)
- #@gui : Mesh Y = float(16,1,256)
- #@gui : Mesh smoothness = float(0.5,0,10)
- #@gui : Contrast scheme = choice(1,"Arctan","Clip")
- #@gui : Mesh contrast = float(75,0,100)
- #@gui : Normalise = bool(0)
- #@gui : Output mesh = bool(0)
- fx_jiff_bomb :
- repeat $! l[$>]
- fx_jpeg_artefacts $2
- fx_blend_bomb $1,1,${3-7},0,0,${8-9}
- endl done
- fx_jiff_bomb_preview :
- fx_jiff_bomb $*
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement