The message below is being cross-posted from the LogoForum. Please
reply here at comp.lang.logo and it will be cross-posted back to the
LogoForum. The original author of this message is
Andreas.Micheler@[EMAIL PROTECTED]
Juan,
In aUCBLogo-4.8 this will be possible:
to test_imagefilter
clearScreen
im=loadImage "grass.jpg
width=(BitMaxX im)+1
m=reRGBA toMatrix im
; simpleLowPass m
FFTfilter m
im2=(Bitmap RGBA m.1 m.2 m.3 m.4)
BitPaste im2
end
to simpleLowPass m
filterstrength=2
repeat 2
[ for [i 1 4][m.i=lowpassFilter m.i filterstrength]
for [i 1 4][m.i=transpose m.i]
]
end
to FFTfilter m
for [i 1 3][m.i=FFT m.i]
mx=MatrixWidth m.1
my=MatrixHeight m.1
x0=int mx/2
y0=int my/2
r=int mx/5
Home
setFloodColor RGB 0 0.2 0.5
fillRect (list -x0 -y0)(list x0 y0)
setFloodColor rgb 1 1 1
PenUp
setXY x0 y0 fillCircle r
setXY x0 -y0 fillCircle r
setXY -x0 y0 fillCircle r
setXY -x0 -y0 fillCircle r
bm=BitCopy mx my
bm=BitResize bm mx my
BitMakeTransparent bm 0
mask=Array 3
mask.1=(Float (BitAnd (Array bm) 255))/255
mask.2=(Float (BitAnd LShift (Array bm) -8 255))/255
mask.3=(Float (BitAnd LShift (Array bm) -16 255))/255
for [i 1 3][m.i=(toMatrix (Array m.i)*mask.i)]
for [i 1 3][m.i=invFFT m.i]
setXY x0+10 -100
end
to zero_circle m
for [y -r r]
[ for [x -r r]
[ if (sqrt x*x+y*y) < r
[ ix=saturateAbove mx saturateBelow 1 x+x0
iy=saturateAbove my saturateBelow 1 y+y0
m.ix.iy=0
]
]
]
end
This already works here, :-)
but I have problems with the stability of aUCBLogo-4.8,
the checks dont pass, so I cannot upload it yet.
The FFTfilter routine multiplies the spectrum of the image with a mask,
which is generated simply by drawing.
The mask is split in the three color channels.
So you can generate pretty much any FFT image filter effect. :-)
Cheers,
Andreas
__._,_.___
LogoForum messages are archived at:
http://groups.yahoo.com/group/LogoForum


|