Well, maybe this is not really what you want, but if you want to do filtering with avisynth... how about creating 2 images. After filtering one, load both in photoshop (or gimp, or something...) and cut+overlay face from unfiltered image (using your mask or not) by just few clicks? IMHO such scripts for processing one image is way overkill... EDIT: by the way if your image originally was in RGB, you loosing much information by doing converttoyv12(). Also I don't see much point in ConvertToRGB32() after Imagesource()