So I am trying to remove the logo from this clip that I have. Luckily I have two different captures, each one with a logo in a different place.
I am trying to remove it by using Mask/Layer, extracting a small part of the logo-less part of one video and stamping it on the other. This of course won't blend in perfectly, which gives me a few ideas:
1. Use a mask that's not rectangular in shape. With an irregular shape it's harder to spot the difference.
2. Blend the surrounding area where I performed this "surgery" with Mask/Layer
3. Add noise/blur to the surrounding area, although this won't look very good because it's a 720p video.
I am sure this has been attempt before, does anyone have ideas/pointers or links to threads discussing this?
+ Reply to Thread
Results 1 to 14 of 14
If they are identical captures without frame drops, and clean signal (noiseless), then it should blend in perfectly
What is causing it to "not blend in" ? is it noise? or something else ? Can you post a sample or screenshots ?
You can feather a mask (which is basically your #2+3 combined), but if the limiting factor is noise, this won't help
I do this sort of thing with some frequency. For example, I recently had a video with a godawful logo smack dab in the middle:
I wanted it for both YouTube and for a DVD project I was making. The logo remover could only blur it:
So I found a video of the same song on YouTube, a video inferior in every way except it didn't have a logo. I cut out a small piece of it and overlaid it on top of mine:
And here's the YouTube result.
In spite of my best efforts to match the levels, brightness, and contrast of the 2 videos, I couldn't make it work quite right. I didn't (and still don't) know how to feather the edges, so you can sort of tell that the middle rectangle doesn't exactly match the rest of it. It's still way better than that horrible logo. pdr, how do you blend the edges? The AviSynth script goes something like:
B=B.Crop(to the dimensions you want)
Overlay(A,B,X=,Y=)#X and Y being the location where the logo is to go.
Hmmm... I don't know how to put the pics where I want them. Top to bottom they're Original, Blurred Delogo, Final.
Last edited by manono; 8th Feb 2011 at 03:37.
Last edited by jagabo; 8th Feb 2011 at 08:13.
Wouldn't the mask be better with a white-to-black gradient on the side too?
Otherwise you will still see an abrupt transition there (unless the strip is the entire clip width).
The inner white rectangle should be the same size as the logo frame, so the overlay clip needs to be slightly bigger than the original attempt (ie include more of the non-logo clip).
One way to construct such a mask in Avisynth is to create the black and white rectangles with BlankClip, overlay the inner white rectangle on top, then blur the result.
Thanks for your help, the both of you. And maybe pfxz will benefit. OK, I know how to create a black rectangle slightly larger than the original rectangle, and how to overlay a somewhat smaller white rectangle in the middle. I know how to blur the entire thing to blend between white and black. But I have next to no understanding of alpha blending. The Overlay page at the AviSynth site has an example I don't quite understand that goes something like this (edited to suit this example):
Mask = C.ShowAlpha("RGB").ConvertToYUY2.
Overlay(A,B, Mask,X=,Y=)X and Y being the location coordinates
And that's it?
A=the 'original' video with the logo still there.
B=the rectangle of new logoless video.
C= the black and white somewhat larger rectangle.
Somehow I have a feeling that's not quite right, if for no other reason than the Mask coordinates should be slightly different than the B coordinates.
Last edited by manono; 8th Feb 2011 at 20:08.
If I can suggest a slightly different approach:
I would generate a mask layer the same dimensions as your video in your image editor (photoshop, gimp, etc....) . White is "see-through" or the "cut out area".
1) This way you don't have to worry about x,y positions, and you can adjust the amount of blur right in avisynth, using avsp to increase or decrease instead of having to go back & forth to your image editor.
2) You don't have to use alpha channel either using this method; "white" in the mask becomes the alpha, and the blurred edges are % of transparency (so 50% white would be 50% transparent)
3) You can use non "rectangle" shapes a lot easier
b=mask layer, and you can blur this
c=layer that you want to appear through the mask
If you wanted to increase the blur, adjust it in the gaussianblur(x) , (or replace it with whatever blur algorithm you want)
Last edited by poisondeathray; 8th Feb 2011 at 20:01.
Thanks! Sounds a bit easier for the clueless like me. Make the mask the same size as the source video. And it has to be a PNG, right? pfxz asked the same question at Doom9 and the first response is similar to yours, poisondeathray, except he reversed the black and white:
actually it doesn't matter if it's png, but png is lossless so it's a good choice. I'm pretty sure white is "see through" , I'll double check - eitherway it's quite simple to invert a mask
when you use the other method with alpha channel , then you need png with alpha (RGBA instead of just RGB)
I'll post an example for the benefit of others that aren't too familiar with avisynth
Yes, white is "see through".
So I heard purple lipstick is all the rage these days...
Layer to Show through
Result1 without blur (notice the hard edge)
Result2 with gaussianblur(1) (softer lips, yummier)
b2=ImageSource("2 mask.png").converttoyv12().gaussianblur(1) #white is "see through"
For those unfamiliar with avisynth:
b1 is the mask plain, b2 is the mask with the blur, if you wanted to feather the mask more, just increase the value
In this example, converttoyv12() is only needed because the gaussianblur requires YUV colorspace ; Overlay will work with RGB as well ; you can mix & match actually
I uploaded the files in a zip file in case the imagehost goes down, and people can play with the script
Apparently there is a way to adjust the mask size using masktools in avisynth to increase/decrease , mt_expand or something like that.... I'm not sure how to do that, maybe jagabo or gavino knows
Last edited by poisondeathray; 8th Feb 2011 at 20:40.
Cool, thanks for taking the time to do that.
I like the chick on the right.