Glitch Art Filters?


(dumb) #161

Updated again. The tile shifting has been added alongside bomb blending (which won’t replace the classic JIFF self-bomb script because that’s quicker). At this point I’ve sorted out almost everything and all that’s left are extras which aren’t in a typical ‘JPEG glitch’ as well as more precise control over what goes on alongside bug fixes. I’ve been casual about batch processing - which the artefacts script can do but mine couldn’t. I’ll take a break and then turn towards that.

A current issue is that it uses quite a lot of memory, enough that it segfaults with anything above half a megapixel on my machine. How do I get it to use less memory? Whatever it is, it’s not in the fill blocks but it’s in the biggest repeat block.


(dumb) #162

I think I’ve fixed the memory issue, it was caused by the inclusion of a lot of float values. It’s now a lot quicker and I can go above 4 megapixels without RAM problems. There are more things that I want to include to make it really powerful and screwed up, though.

#@gui JFIF Effects : fx_jfif, fx_jfif_preview(0)
#@gui : note = note("<small>A poorly-implemented jfif encoder designed to screw with images. Quite slow and very aggressive.</small>")
#@gui : 1. Quality (%) = int(50,1,100)
#@gui : 2. Encoding = choice(3,"444","442","424","422")
#@gui : sep = separator()
#@gui : note = note("Fake Glitch")
#@gui : 3. Power = float(0,0,10)
#@gui : 4. Colour Distortion = float(1,0,2)
#@gui : 5. Max Glitch Length = int(5,2,10)
#@gui : 6. Tile Error Power = float(0.25,0,1)
#@gui : 7. Persistent Tile Error Power = float(0.25,0,1)
#@gui : 8. Max Value Errors Per Tile = int(5,0,10)
#@gui : 9. Tile Shift Power = float(0.25,0,1)
#@gui : sep = separator()
#@gui : note = note("Self-Bomb")
#@gui : 10. Enable = bool(0)
#@gui : 11. Mesh X = int(16,1,256)
#@gui : 12. Mesh Y = int(16,1,256)
#@gui : 13. Mesh smoothness = float(0.5,0,10)
#@gui : 14. Contrast scheme = choice(1,"Arctan","Clip","Power)
#@gui : 15. Mesh contrast = float(75,0,100)
#@gui : 16. Scale X = float(1,0.05,16)
#@gui : 17. Scale Y = float(1,0.05,16)
#@gui : 18. Interpolation = choice(0,"None","Nearest","Average","Bilinear","Grid","Bicubic")
#@gui : 19. Normalise = bool(0)
#@gui : 20. Output mesh = bool(0)
#@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: Joan Rake, \'borrowed\' from <i><a href="https://goo.gl/Ryf7Cv">David Tschumperl&#233;</a></i>.      Latest Update: <i>2017/05/07</i>.</small>")
fx_jfif :
cd={$4^2.5}
gl=$5
te=$6^2
ste=$7
ve=$8
ts=$9^2
base642img "MSBmbG9hdCBsaXR0bGVfZW5kaWFuCjggOCA2NCAxICMyMjIyCnic5Vs9q51FEC60kKtWMYpaCirYKCoI767iR6UoSangtdM/EAM2Fgab2FhaWdgIUXOqVO8sXEHBVDFia6kgCBaCQSyu+5w8c3nv5p55Bg+3uSmGs19nP2Z2Zt752P39/bJ/G8PHF5+qD1y4v77+yNWyeulegPWy9bbW+9pJ7z9XH6s/f3KxdLBeRr2hjDb0nfR+4OZyxwlw8UbHS4f1nehtBTg66f3kAyOU261OfDTiA/ehEV91ga8T208+cDlg5JNKPiknvR8ykfKwLuRlo7y0k96PegS8MxsB80RAnROBRYC9R0AZtxF45o1w+cXz9fHvztTnP7y7nv7z5dLBern1NvTht37/75P17Qt/lOsPPQqwXrbeth6D/6Hv3F2fl2/++WXqMPfyegzmwZz439e9755fHwbMvTxjHqwFQBlt6MMYjMV/8F/MgbkwJ+bGGlgLa2Jt7AF7wRjMg/+hD3vG3nmGxr0Y5/S+euPGe/XVJ/ZKB+vlBkAZbeh77ctX6re/f1E6WC83AMpoQ9+Zd++oV6+8WTpYLzcAymhD30+fPlee/e2zqcPcywZAGW3oO6J+aPw437jeuJ9xv+N5xvMCD/d1vABPL3QcdVjjpbcV4rb+2PGK8jsdxx3QjrZCvJevOl2A3/c7jTqs8dvbJtKkgK7A/eU+rsMEGoDOpJehjDb0YQzG4j+kp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h/1jvsf4X972r6X4//3fl9gv9nvcP+t7H/FdP/evzv7i8k9H93fp7Q/6feTf3jgH8T+r+7P5DQ/6febeuHe6wfEvq/Oz9P6P+Tf6l/zXmI0b88/d/dH0jo/031zgtTPxyzfkjo/+78PKH/T/6l/tmof1ajf3r6v7s/kND/G/XPWT9Q/2yqfwb6vzs/T+j/lfp3o/49+dfo357+7+4PJPT/Rv37oH5QeyT0f3d+ntD/K+cfjfOPyb9m/uHp/+7+QEL/b5x/HNQPxB/2/9H8PKH/T/7l/Ktx/lXN/MvT/939gYT+3zj/mvUD519N51+B/u/OzxP6/+Rfzj+nHm7mn57+7+4PJPR/9bdcmPqB+S+c/0fz84T+P+cdnH8f8G9C/3f3BxL6/5x32PqB/Bf2/xF/Wr7b2f9z5/eJ/T+3fsjoD97+QmL/z+XPy3j/z53fJ/b/3Pohqz/s7S8k9v9c/ryM9//c+X1i/8+tH7L6w97+QmL/z+XPy3j/z53fJ/b/3Pohoz94+wuJ/T+XPy/j/T93fp/Y/3Prh4z+4O0vJPb/XP68jPf/3Pl9Yv/PrR+y+sPe/kJi/8/lT+Pvvf0/d36f2P9z64es/rC3v5DY/3P509Y7O/t/7vw+sf/n1g8Z/cHbX4j4P5qfZ/vvPf0+0v+j/YGo/ojmF4nf/7nz82z/vaffR/p/tD8Q1R/R/CLx+z93fp7tv/f0+0j/j/YHovojml8kfv/nzs+z/feefh/p/9H+QFR/RPOLxO//3Pl5tv/e0+8j/T/aH4jqj2h+kfj9nzs/z/bfe/p9pP9H+wNR/RHNLxK//3Pn59n+e0+/j/T/aH8gqj+i+UXi93/u/Dzbf+/p95H+H+0PRPVHNL/4DgTd2gQ="
nm[-2,-1] dct,idct
i[Q] (16,11,10,16,24,40,51,61;12,12,14,19,26,58,60,55;14,13,16,24,40,57,69,56;14,17,22,29,51,87,80,62;18,22,37,56,68,109,103,77;24,35,55,64,81,104,113,92;49,64,78,87,103,121,120,101;72,92,95,98,112,100,103,99)
f. "const S = $1<50?5000/$1:200-2*$1; max(1,round((S*i+50)/100,1,-1))"
repeat {$!-3} l[$>,-3--1]
gp={(0.25^((10-$3)*log(wh(#0))/30))*$3/10}
if $10
ww={w(#0)}
hh={h(#0)}
r[$>] {$16*100}%,{$17*100}%,100%,100%,$18
fi
i[G] {w(#0)},{h(#0)},1,1 f[$G] ">begin(chance = "$gp"; tlmax="$gl"; tt=-1; val=0; sticky="$ste");
if (!(x%16) && !(y%16),for (l = 0, l<2, ++l, for (k = 0, k<2, ++k, (u<=chance?((val=1);tt=round(u(1,tlmax))):tt>=0?(val=0;--tt):(u<=sticky?(val=-2):val=-1)); j(k*8,l*8)=val)),0)"
l[0] w,h={[w,h]} r {w+(-w%16)},{h+(-h%16)},1,100%,0,3 rgb2srgb gcd_srgb2jpeg s c
if {$2==1} r[-2,-1] 100%,50%,1,1,2 elif {$2==2} r[-2,-1] 50%,100%,1,1,2 elif {$2==3} r[-2,-1] 50%,50%,1,1,2 fi round. endl
bw,bh=8
repeat 3
if {$>==1}
if {$2==1} bh=16 elif {$2==2} bw=16 elif {$2==3} bh,bw=16 fi
fi
[$>]
f[$>] ">begin(boundary = 2; res = vector64(); const cbw="$bw"; const cbh="$bh"; const cbwh=cbw*cbh; glitch=0; cold="$cd"; gval=1; errtile=0; sticky=0; errval="$ve"; tileerr="$te"; tileerror=0);
if (!(x%(128/cbw)) && !(y%(128/cbh)),for (ll = 0, ll<(16/cbw), ++ll, for (kk = 0, kk<(16/cbh), ++kk,
src = crop(x+(ll*8),y+(kk*8),8,8);
gpunch=crop(#"$G",cbw/8*(x+(ll*8)),cbh/8*(y+(ll*8)),cbw,cbh);
max(gpunch)==1?(glitch=1);
glitch==1?(gval=cut(gval+(u(-cold,cold)/15),0,1);(u<=tileerr?tileerror=1);errnum=u(1,errval);for (ve=0,ve<errnum,++ve,src[u(0,63)]=u(-30,30)));
tileerror==1?errtile=u(0,64);
for (l = 0, l<8, ++l, for (k = 0, k<8, ++k, off = k + 8*l; res[off] = int(sum(gval*src*crop(#"$dct",0,0,(off+errtile)%64,8,8,1)))));
draw(#-1,res,x+(ll*8),y+(kk*8),0,0,8,8);
min(gpunch)<=-1?(glitch=0;errnum=0;tileerror=0;min(gpunch)==-1?errtile=0)))); i"
round.
+r[$Q] {$>,w},100%,1,1,0,2 /.. . round.. *[-2,-1]
dispw={w(#1)}
f. ">begin(boundary = 2; res = vector64(); const cbw="$bw"; const cbh="$bh"; const cbwh=cbw*cbh; glitch=0; cold="$cd"; gval=0; errtile=0; sticky=0; errval="$ve"; tileerr="$te"; tileerror=0; const dispwidth="$dispw";disp=0;shift="$ts";toff=0;tswitch=0);
if (!(x%(128/cbw)) && !(y%(128/cbh)),for (ll = 0, ll<(16/cbw), ++ll, for (kk = 0, kk<(16/cbh), ++kk,
src = crop((x+(ll*8+cbw*disp))%(dispwidth/cbw*16),y+(kk*8)+cbh*floor((x+cbw*disp)/(dispwidth/cbw*16)),8,8);
gpunch=crop(#"$G",cbw/8*(x+(ll*8)),cbh/8*(y+(ll*8)),cbw,cbh);
max(gpunch)==1?(glitch=1);
glitch==1?((u<=shift?++disp);errnum=u(1,errval);gval=cut(gval+(u(-cold,cold)/5),-1,5);(u<=tileerr?tileerror=1;tswitch=1);errnum=u(1,errval);for (ve=0,ve<errnum,++ve,src[u(0,63)]=u(-30,30)));
tileerror==1?(errtile=u(0,64);toff=gval*u(2));
tswitch==1?(for (l = 0, l<8, ++l, for (k = 0, k<8, ++k, off = k + 8*l; res[off] = int(sum(cut(gval+src*crop(#"$idct",0,0,(off+errtile)%64,8,8,1),gval,10000)))))):(for (l = 0, l<8, ++l, for (k = 0, k<8, ++k, off = k + 8*l; res[off] = int(sum(gval+src*crop(#"$idct",0,0,(off+(errtile))%64,8,8,1))))));
draw(#"$>",res+toff,x+(ll*8),y+(kk*8),0,0,8,8);
min(gpunch)<=-1?(glitch=0;errnum=0;tileerror=0;min(gpunch)==-1?(errtile=0;tswitch=0))))); i"
rm.
l[$>] r {w*($bw/8)},{h*($bh/8)},1,1,1 endl
round[$>]
done
rm[$G]
l[^4--1] a c gcd_jpeg2srgb srgb2rgb round. r $w,$h,1,3,0
if $10 blend_bomb 1,${11-15},0,0,0,${19-20}
r $ww,$hh,100%,100%,$18 fi
endl
endl done
rm[$dct,$idct,$Q]
fx_jfif_preview :
#fx_jfif $*
gui_split_preview "fx_jfif $*",${-3--1}

#163

I have just tested it, and I’m loving it.

image

It is even better than the one from PDN plugin. I consider it done myself. Your row shifter filter can replace a lot of those filters though there isn’t any way to get the quadratic look to it. So, there’s at least 2 more glitch filters missing. Spiral, and Quadratic, and then it’s all done.

By the way, I found this - https://www.hellocatfood.com/jpg-glitch-pattern-generator/


(dumb) #164

You should keep and fork the old one if you want since it works absolutely fine but I want to add more tweakability and more meaningful options. This newer version is quite a bit slower again (though not as bad as it was before I fixed it last time) but it’s far more configurable and doesn’t come with those older tile errors which were a bit hard to manage.

#@gui JFIF Effects : fx_jfif, fx_jfif_preview(0)
#@gui : note = note("<small>A poorly-implemented JFIF encoder with extras, all designed to screw with images. Quite slow and very aggressive.</small>")
#@gui : 1. Quality (%) = int(50,1,100)
#@gui : 2. Encoding = choice(3,"444","442","424","422")
#@gui : sep = separator()
#@gui : note = note("Fake Glitch")
#@gui : 3. Power = float(0,0,10)
#@gui : 4. Colour Distortion = float(1,0,2)
#@gui : 5. Max Glitch Length = int(5,2,10)
#@gui : 6. Max Value Errors Per Tile = int(5,0,10)
#@gui : 7. Error Strength = float(0,1,8)
#@gui : 8. Persistent Value Errors Power = float(0.25,0,1)
#@gui : 9. Error Bias = float(0.5,0,1)
#@gui : 10. Tile Shift Power = float(0.25,0,1)
#@gui : 11. Mirror = choice("None","X","Y","XY")
#@gui : 12. Rotate = choice("None,"90 clockwise","180","90 anticlockwise")
#@gui : sep = separator()
#@gui : note = note("Self-Bomb")
#@gui : 13. Enable = bool(0)
#@gui : 14. Mesh X = int(16,1,256)
#@gui : 15. Mesh Y = int(16,1,256)
#@gui : 16. Mesh smoothness = float(0.5,0,10)
#@gui : 17. Contrast scheme = choice(1,"Arctan","Clip","Power)
#@gui : 18. Mesh contrast = float(75,0,100)
#@gui : 19. Scale X = float(1,0.05,16)
#@gui : 20. Scale Y = float(1,0.05,16)
#@gui : 21. Interpolation = choice(0,"None","Nearest","Average","Bilinear","Grid","Bicubic")
#@gui : 22. Normalise = bool(0)
#@gui : 23. Output mesh = bool(0)
#@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: Joan Rake, \'borrowed\' from <i><a href="https://goo.gl/Ryf7Cv">David Tschumperl&#233;</a></i>.      Latest Update: <i>2017/05/07</i>.</small>")
fx_jfif :
cd={$4^2.5}
gl=$5
ve=$6
es=$7
ste=$8
bias={2^(6-($9*12))}
ts={$10^2}
base642img "MSBmbG9hdCBsaXR0bGVfZW5kaWFuCjggOCA2NCAxICMyMjIyCnic5Vs9q51FEC60kKtWMYpaCirYKCoI767iR6UoSangtdM/EAM2Fgab2FhaWdgIUXOqVO8sXEHBVDFia6kgCBaCQSyu+5w8c3nv5p55Bg+3uSmGs19nP2Z2Zt752P39/bJ/G8PHF5+qD1y4v77+yNWyeulegPWy9bbW+9pJ7z9XH6s/f3KxdLBeRr2hjDb0nfR+4OZyxwlw8UbHS4f1nehtBTg66f3kAyOU261OfDTiA/ehEV91ga8T208+cDlg5JNKPiknvR8ykfKwLuRlo7y0k96PegS8MxsB80RAnROBRYC9R0AZtxF45o1w+cXz9fHvztTnP7y7nv7z5dLBern1NvTht37/75P17Qt/lOsPPQqwXrbeth6D/6Hv3F2fl2/++WXqMPfyegzmwZz439e9755fHwbMvTxjHqwFQBlt6MMYjMV/8F/MgbkwJ+bGGlgLa2Jt7AF7wRjMg/+hD3vG3nmGxr0Y5/S+euPGe/X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zbf+/p95H+H+0PRPVHNL/4DgTd2gQ="
nm[-2,-1] dct,idct
i[Q] (16,11,10,16,24,40,51,61;12,12,14,19,26,58,60,55;14,13,16,24,40,57,69,56;14,17,22,29,51,87,80,62;18,22,37,56,68,109,103,77;24,35,55,64,81,104,113,92;49,64,78,87,103,121,120,101;72,92,95,98,112,100,103,99)
f. "const S = $1<50?5000/$1:200-2*$1; max(1,round((S*i+50)/100,1,-1))"
repeat {$!-3} l[$>,-3--1]
gp={(0.25^((10-$3)*log(wh(#0))/30))*$3/10}
ww={w(#0)}
hh={h(#0)}
if {$11==1}
mirror[0] x
elif {$11==2}
mirror[0] y
elif {$11==3}
mirror[0] xy
fi
if $12
rotate[0] {$12*90},0
fi
if $13
www={w(#0)}
hhh={h(#0)}
r[0] {$www*$19},{$hhh*$20},100%,100%,$21
fi
i[G] {w(#0)},{h(#0)},1,1 f[$G] ">begin(chance = "$gp"; tlmax="$gl"; tt=-1; val=0; sticky="$ste");
if (!(x%16) && !(y%16),for (l = 0, l<2, ++l, for (k = 0, k<2, ++k, (u<=chance?((val=1);tt=round(u(1,tlmax))):tt>=0?(val=0;--tt):(u<=sticky?(val=-2):val=-1)); j(k*8,l*8)=val)),0)"
l[0] w,h={[w,h]} r {w+(-w%16)},{h+(-h%16)},1,100%,0,3 rgb2srgb gcd_srgb2jpeg s c
if {$2==1} r[-2,-1] 100%,50%,1,1,2 elif {$2==2} r[-2,-1] 50%,100%,1,1,2 elif {$2==3} r[-2,-1] 50%,50%,1,1,2 fi round. endl
bw,bh=8
repeat 3
if {$>==1}
if {$2==1} bh=16 elif {$2==2} bw=16 elif {$2==3} bh,bw=16 fi
fi
[$>]
f[$>] ">begin(boundary = 2; res = vector64(); gres = vector64(); const cbw="$bw"; const cbh="$bh"; const cbwh=cbw*cbh; glitch=0; const cold="$cd"; gval=1; const errval="$ve"; const bias = "$bias"; const strength="$es");
if (!(x%(128/cbw)) && !(y%(128/cbh)),for (ll = 0, ll<(16/cbw), ++ll, for (kk = 0, kk<(16/cbh), ++kk,
src = crop(x+(ll*8),y+(kk*8),8,8);
gpunch=crop(#"$G",cbw/8*(x+(ll*8)),cbh/8*(y+(ll*8)),cbw,cbh);
max(gpunch)==1?(glitch=1);
glitch==1?(gval=cut(gval+(u(-cold,cold)/15),0,1);errnum=u(1,errval);for (ve=0,ve<errnum,++ve,gres[int(floor((u^bias)*8)+floor((u^bias)*8)*8)]=round((u(-strength,strength)^5),0.1,1)));
for (l = 0, l<8, ++l, for (k = 0, k<8, ++k, off = k + 8*l; res[off] = int(gres[off]+sum(gval*src*crop(#"$dct",0,0,off,8,8,1)))));
draw(#-1,res,x+(ll*8),y+(kk*8),0,0,8,8);
min(gpunch)<=-1?(glitch=0;errnum=0;tileerror=0;min(gpunch)==-1?gres=vector64(0))))); i"
round.
+r[$Q] {$>,w},100%,1,1,0,2 /.. . round.. *[-2,-1]
dispw={w(#1)}
f. ">begin(boundary = 2; res = vector64(); const cbw="$bw"; const cbh="$bh"; const cbwh=cbw*cbh; glitch=0; const cold="$cd"; gval=0; const dispwidth="$dispw";disp=0;shift="$ts");
if (!(x%(128/cbw)) && !(y%(128/cbh)),for (ll = 0, ll<(16/cbw), ++ll, for (kk = 0, kk<(16/cbh), ++kk,
src = crop((x+(ll*8+cbw*disp))%(dispwidth/cbw*16),y+(kk*8)+cbh*floor((x+cbw*disp)/(dispwidth/cbw*16)),8,8);
gpunch=crop(#"$G",cbw/8*(x+(ll*8)),cbh/8*(y+(ll*8)),cbw,cbh);
max(gpunch)==1?(glitch=1);
glitch==1?((u<=shift?++disp);gval=cut(gval+(u(-cold,cold)/5),-1,5));
for (l = 0, l<8, ++l, for (k = 0, k<8, ++k, off = k + 8*l; res[off] = int(sum(gval+src*crop(#"$idct",0,0,off,8,8,1)))));
draw(#"$>",res,x+(ll*8),y+(kk*8),0,0,8,8);
min(gpunch)<=-1?(glitch=0;errnum=0;min(gpunch)==-1?gres=vector64(0))))); i"
rm.
l[$>] r {w*($bw/8)},{h*($bh/8)},1,1,1 endl
round[$>]
done
rm[$G]
l[^4--1] a c gcd_jpeg2srgb srgb2rgb round. r $w,$h,1,3,0
if $13 blend_bomb 1,${14-18},0,0,0,${22-23}
r $www,$hhh,100%,100%,$21 fi
if $12
rotate[0] {-$12*90},0
fi
if {$11==1}
mirror[0] x
elif {$11==2}
mirror[0] y
elif {$11==3}
mirror[0] xy
fi
endl
endl done
rm[$dct,$idct,$Q]
fx_jfif_preview :
fx_jfif $*
#gui_split_preview "fx_jfif $*",${-3--1}

As for what you’ve found, that’s a script that’ll take a while but will have a really nice result. I’d have to loop the classic ‘JPEG artefacts’ script over something that resizes an image.


(dumb) #165

A little something extra.


#166

Could be a pattern on a rug or t-shirt. :smile:


(http://4232.cf) #167


radio noise con SSTV (slow scan TV)
https://www.sigidwiki.com/wiki/SSTV


#168

@Joan_Rake1 This has been bugging me a while as my blending modes for Krita is finally accepted, and I had it before when developing blending modes. What do you think about a new filter idea called ‘Psychedelia Blending’ which utilize weird blending modes equations that doesn’t really fit for usual purposes at all. Used to radically alter the tone or colors of images.

For a preliminary filter, this filter should use at least 4 blending modes

Assuming 0,1 range

f.circle1(a,b) = (1-a)^2+a^2+(1-b)^2+b^2-1
f.circle2(a,b) = (a^2+b^2>.25^2)?1.5*f.circle1:0
f.psychedelic1(a,b)=.5-sin(pi*a/.5)*sin(pi*b/2)*.5

These are examples I found.


(Ingo Weyrich) #169

I wanted to quote your equation but ended up with the quote above. Imho that could be improved.
Not your equation, but the quoting of math formulas on pixls.us.

Concerning your equation: Could you clarify by adding brackets?

For example -a² + a² + -b² + b² -1 can be -1 or 2*(a² + b²) -1

Edit: I just saw you modified your post. All good :slight_smile:


#170

Had some fun: gmic sp tiger +mirror x circle1

Oops, if I normalize tiger to [0,1] prior to circle1, the result would be




gmic sp tiger +mirror x circle2




gmic sp tiger +mirror x psychedelic1


(G'MIC staff) #171

One small one-liner discovery today, that looks like glitch-art:

$ gmic sp lena b 50 +round - n 0,255

(It just keeps a kind of signed fractional part of the blurred pixel values).

lena_glitch

It gives also nice weird things when applied on a random image:

$ gmic 500,500,1,3 rand 0,255 b 20 +round - n 0,255

rand_glitch

Also, with a simple shape :

$ gmic shape_circle 200 n 0,255 frame 100,100,0 b 40 +round - n 0,255

circle_glitch


(G'MIC staff) #172

And in the same spirit, it’s interesting to reverse the byte order of a blurred + multiplied image:

$ gmic sp lena b 5 mul 16 endian ushort n 0,255

lena_glitch2


(G'MIC staff) #173

I’ve added a new filter in the plug-in : Degradations / Mess With Bits

It basically allows to re-order bits of an input image to create glitch effects.


(dumb) #174

@bazza That can be done using a row shifter script or the warp command and some scanlines generator. I wouldn’t use a row shifter now because there’s a problem with image borders which I can’t seem to fix using a script.

@Reptorian Those formulae are good ideas and they can be adapted to work as examples for the mesh blend script and the CSG script. The ‘psychedelic’ one looks like it could have more parameters than just the two input pixels for the sine wavelengths, and that reminds me of an old exploration of blending mode parameters in a thread whose whereabouts I can’t remember.

@David_Tschumperle Great discoveries, I’ll update the filter list accordingly and maybe see what I can do with them.


#175

Okay, now that I’m finished with modulo operations cli commands, I updated my reptorian.gmic via github. I also notified @Joan_Rake1 to see what he can do using those. You can see my earlier edit to see the effect of the modulo operations cli commands.

Another experiment with the modulo operations cli


I like the texture here.
image
Trying to mimic this idea - https://forums.getpaint.net/topic/113695-how-to-posterize/


(Hebus Tetram) #176

David, is the above the code behind plug-in : Degradations / Mess With Bits ?

When I tested the code in custom code applied to some of the channels, I found a couples of interesting results.
In particular when applied to Lab [Lightness] , CMYK [Key] , HSL [Lightness].

Would it be feasible to add to “Mess with Bits” a selector of the channel ?


(G'MIC staff) #177

I think so, yes. Good idea, indeed :slight_smile:


(G'MIC staff) #178

Done. And I’ve also added an ‘Opacity’ parameter in ‘output settings’ to be able to make the effect more subtle if necessary.


#179

I finished my modulo CLI command. Now, it’s ready for filter writing, and a lot easier to write sawtoother, that’s for sure.