MadRat
10th October 2009, 23:05
I found this still image from the movie Bladerunner that I want to use as a wallpaper. The problem is the still is filled with noise; so I did what I could to remove the noise but that left the face was over filtered. I spent the next 8 hours trying to figure out how to use masks, layers and overlays to cut out the head, filter the background, filter the head separately then recombine it back into one image. I've gotten pretty close but there are still nasty artifacts around the outside of the mask.
Original
http://img257.imageshack.us/img257/2366/bladerunneroriginal.th.png (http://img257.imageshack.us/i/bladerunneroriginal.png/)
Mask
http://img18.imageshack.us/img18/4391/bladerunnermask.th.png (http://img18.imageshack.us/i/bladerunnermask.png/)
Script
bg=ImageSource("bladerunner-original.png").ConvertToRGB32() #load the noisy image
msk=ImageSource("bladerunner-mask.png").ConvertToRGB32() #load the image mask
msk=Mask(msk,msk) #set up the image mask
background=layer(bg,msk) #layer the image mask with the original file to create a background with a hole cut out for the head
msk2=invert(msk) #reverse the image mask
msk2=Mask(msk2,msk2) #set up the reversed image mask
head=layer(bg,msk2) #layer the image mask with the original file so that all that's seen is the head
# Massively denoise the background then sharpen
converttoyv12(background)
fft3dfilter(sigma=10,bt=4,plane=0,sharpen=1,bw=32,bh=32,ow=16,oh=16)
lsfmod()
ConvertToRGB32()
background2=last
# Denoise the head but less than the background then sharpen
converttoyv12(head)
fft3dfilter(sigma=6,bt=4,plane=0,sharpen=1,bw=32,bh=32,ow=16,oh=16)
lsfmod()
ConvertToRGB32()
head2=last
maskclip = ColorKeyMask(head2, $ffffff, 15) #make white the transparent color
Overlay(background2,head2, mask=ShowAlpha(maskclip), mode="blend", opacity=1) #put everything togehter
Obviously I'm doing something wrong. I've been reading threads and documentation all day but can't find an example that demonstrates what I want to do. Can anyone offer any help?
Original
http://img257.imageshack.us/img257/2366/bladerunneroriginal.th.png (http://img257.imageshack.us/i/bladerunneroriginal.png/)
Mask
http://img18.imageshack.us/img18/4391/bladerunnermask.th.png (http://img18.imageshack.us/i/bladerunnermask.png/)
Script
bg=ImageSource("bladerunner-original.png").ConvertToRGB32() #load the noisy image
msk=ImageSource("bladerunner-mask.png").ConvertToRGB32() #load the image mask
msk=Mask(msk,msk) #set up the image mask
background=layer(bg,msk) #layer the image mask with the original file to create a background with a hole cut out for the head
msk2=invert(msk) #reverse the image mask
msk2=Mask(msk2,msk2) #set up the reversed image mask
head=layer(bg,msk2) #layer the image mask with the original file so that all that's seen is the head
# Massively denoise the background then sharpen
converttoyv12(background)
fft3dfilter(sigma=10,bt=4,plane=0,sharpen=1,bw=32,bh=32,ow=16,oh=16)
lsfmod()
ConvertToRGB32()
background2=last
# Denoise the head but less than the background then sharpen
converttoyv12(head)
fft3dfilter(sigma=6,bt=4,plane=0,sharpen=1,bw=32,bh=32,ow=16,oh=16)
lsfmod()
ConvertToRGB32()
head2=last
maskclip = ColorKeyMask(head2, $ffffff, 15) #make white the transparent color
Overlay(background2,head2, mask=ShowAlpha(maskclip), mode="blend", opacity=1) #put everything togehter
Obviously I'm doing something wrong. I've been reading threads and documentation all day but can't find an example that demonstrates what I want to do. Can anyone offer any help?