Theoreticly you could use a "maskcolor range", so you would manually repaint all pixels that are within the mask color range. The problem with this method is: the contours of the masked object will be antialiased when scaled with filters on, so there may be color tones that are outside the mask color range, but still should be masked. Well you can try it.
Let's assume your mask color is black. So make sure all the visible Pixels are brighter than about 15,15,15. after scaleing you would do something like this:
mask_color=$000000 ; black
setbuffer imagebuffer(img)
lockbuffer()
for j=0 to imageheight(img)-1
for i=0 to imagewidth(img)-1
rgb=readpixelfast(i,j) and $FFFFFF
bri=(((rgb shr 16) and $FF) + ((rgb shr 8) and $FF) + (rgb and $FF))/3
if bri <=15 then writepixelfast i,j,mask_color
next
next
unlockbuffer()
setbuffer backbuffer()
I am not sure if a range of 15 will be enough to catch all filter nuances.
|