First, I’ve worked on the ECB filter once more and used a patched pseudo_c
command:
#@gui Pseudo-ECB (Electronic Code Book Algorithm): pseudo_ecb, _pseudo_ecb_preview(0)
#@gui : note = note("This filter is inspired by one of the glitch plugin for Paint.NET This doesn't actually emulate how the codebook encryption algorithm actually work, but it is inspired from it. This filter uses bomb blending mode which involves RGBA Transfer Function Mesh. See Mesh Blend filter for a link. \n\n <u>Note that the filter works best on images with large patches of single colors.</u> ")
#@gui : sep = separator()
#@gui : note = note("<b>ECB Pattern Key Generator</b>")
#@gui : 1. Double Gradient? = bool(0)
#@gui : 2. Length of Gradient#1 = float(3,0,32)
#@gui : 3. ECB Angle#1 = float(135,0,360)
#@gui : 4. ECB Inversion#1 = bool(0)
#@gui : 5. Length of Gradient#2 = float(3,0,32)
#@gui : 6. ECB Angle#2 = float(135,0,360)
#@gui : 7. ECB Inversion#2 = bool(0)
#@gui : 8. Gradient Blend = choice(41,"add","alpha","and","average","blue","burn","darken",
#@gui : "difference","divide","dodge","exclusion","freeze",
#@gui : "grainextract","grainmerge","green","hardlight","hardmix",
#@gui : "hue","interpolation","lighten","lightness","linearburn",
#@gui : "linearlight","luminance","multiply","negation","or",
#@gui : "overlay","pinlight","red","reflect","saturation","screen",
#@gui : "shapeaverage","softburn","softdodge","softlight","stamp",
#@gui : "subtract","value","vividlight","xor")
#@gui : 9. Gradient Blend Opacity = float(1,0,1)
#@gui : sep = separator()
#@gui : note = note("<b>Sharpen Filtering</b>")
#@gui : 10. Sharpening Noise Processing = float(15,0,200)
#@gui : sep = separator()
#@gui : note = note("<b>ECB Image Processing</b>")
#@gui : 11. Transfer Mesh Size for Image (Squared) = int(256,2,256)
#@gui : 12. Image Mesh Contrast = float(100,0,100)
#@gui : 13. Transfer Mesh Size for Gradient (Squared) = int(16,2,256)
#@gui : 14. Gradient Mesh Contrast = float(100,0,100)
#@gui : 15. Double Encryption Effect = bool(0)
#@gui : 16. Blend 1 = choice(41,"add","alpha","and","average","blue","burn","darken",
#@gui : "difference","divide","dodge","exclusion","freeze",
#@gui : "grainextract","grainmerge","green","hardlight","hardmix",
#@gui : "hue","interpolation","lighten","lightness","linearburn",
#@gui : "linearlight","luminance","multiply","negation","or",
#@gui : "overlay","pinlight","red","reflect","saturation","screen",
#@gui : "shapeaverage","softburn","softdodge","softlight","stamp",
#@gui : "subtract","value","vividlight","xor")
#@gui : 17. Blend 1 Opacity = float(1,0,1)
#@gui : 18. Blend 2 = choice(41,"add","alpha","and","average","blue","burn","darken",
#@gui : "difference","divide","dodge","exclusion","freeze",
#@gui : "grainextract","grainmerge","green","hardlight","hardmix",
#@gui : "hue","interpolation","lighten","lightness","linearburn",
#@gui : "linearlight","luminance","multiply","negation","or",
#@gui : "overlay","pinlight","red","reflect","saturation","screen",
#@gui : "shapeaverage","softburn","softdodge","softlight","stamp",
#@gui : "subtract","value","vividlight","xor")
#@gui : 19. Blend 2 Opacity = float(1,0,1)
#@gui : 20. Blend 3 = choice(18,"add","alpha","and","average","blue","burn","darken",
#@gui : "difference","divide","dodge","exclusion","freeze",
#@gui : "grainextract","grainmerge","green","hardlight","hardmix",
#@gui : "hue","interpolation","lighten","lightness","linearburn",
#@gui : "linearlight","luminance","multiply","negation","or",
#@gui : "overlay","pinlight","red","reflect","saturation","screen",
#@gui : "shapeaverage","softburn","softdodge","softlight","stamp",
#@gui : "subtract","value","vividlight","xor")
#@gui : 21. Blend 3 Opacity = float(1,0,1)
#@gui : 22. Pseudocolouring = bool(1)
#@gui : sep = separator(), 23-25. 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 : <i>Reptorian</i> Latest update: <i>2018/12/28</i>.</small>")
_pseudo_c : v - if {s!=1} to_gray. fi {max(1,iM)},1,1,3,u(255) round. map.. . rm. v +
pseudo_ecb:
repeat $! l[$>]
repeat {$15+1}
pseudo_ecb_generate ${1-14},${16-22}
done
endl done
ecb_gradient_base:
f "ang=pi*$2/180;G=x*cos(ang)+y*sin(ang);G%($1)" n 0,255
if {$3==1} mul -1 abs fi
pseudo_ecb_generate:
-m "MergeChoice : $""=_mode" -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"
+ac "ecb_gradient_base[0] ${2-4}",rgb
if $20 _pseudo_c[1] fi
local[1]
if {$1==1} +ac "ecb_gradient_base[0] ${5-7}",rgb
if $20 _pseudo_c[1] fi
blend ${_mode{$8+1}},$9 equalize fi
endlocal
local[0]
sharpen $10
if $20 +pseudo_c[0] fi
+fx_blend_bomb[0] 0,1,$11,$11,0,2,$12,0,0,0,1,0
blend ${_mode{$15+1}},$16
endlocal
fx_blend_bomb[1] 0,1,$13,$13,0,2,$14,0,0,0,0,0
equalize[1]
blend ${_mode{$17+1}},$18
+equalize
blend ${_mode{$19+1}},$20
_pseudo_ecb_preview :
gui_split_preview "pseudo_ecb $*",${-3--1}
The filter is now able to make trippy patterns like this with ‘pseudocolouring’ off and longer pattern lengths:
As for the QAM filter, here’s the only result I can find (from the PDN forum thread). Ignoring the scanlines, much of the effect is possible with a sinusoidal carrier and a modulo operation in a single channel.
Here’s to_rgb ac "f "(2*i*sin(y/20))%255"",rgb_g
:
…and then to_rgb ac "f "(5*i*sin(y/20)+255/2)%255"",rgb
: