This guide explains how to remove an opaque logo using Xlogo in Avisynth.
Xlogo is an orphan application, apparently abandoned by its author, Leuf.
You can find the last version at Warp Enterprises or this mirror.
And this page archives that and the VirtualDub version. There is more explanatory material there, which applies to both versions, but the following should be sufficient for basic Avisynth usage.
This is an example of the kind of logo it can be used on:
Xlogo only needs one mask image.
It will try to extrapolate from the edges of the mask to fill it in, with imperfect results, but still I think the minimal effort makes a large improvement on an obtrusive coloured logo, and makes it barely noticeable.
We start by finding a frame such as the above, with the logo on a black background if at all possible.
Save a BMP screengrab from, eg, VirtualDub.
Open in your image editor.
I used Photoshop, but any other app will do.
Zoom in and crop around the logo as below:
1) Have at least 4 pixels clear black on all sides of the logo. If the surroundings are not 100% black, make them so (paintbrush, or use the magic wand selector and bucket with black).
2) Note the (x,y) position of the top left corner. Make both even numbers, and the width and height of the cropped area also even.
In this case, the position was (540, 300), width 64, height 24 pixels.
Now paint white over all the logo. The below shows the white as a separate layer, though you don't need to keep the original logo.
The result is :
Now save this black and white version as a BMP.
The name is important. Anything at the beginning (something related to the AVI file name) then "_x_X_y_Y_2" where the capital X and Y are the position (as above) the logo was cropped from (the "_2" at the end is mandatory). (Actually, the x,y in the name is not strictly necessary for the Avisynth version, but it makes it compatible with the VirtualDub filter.)
So in this case I save it as "logo221_x_540_y_300_2.bmp"
Now we can use this in our AVS script.
The trims are to limit xlogo to specific frames of the video. Just omit the trim if you want it for the entire clip.Code:AVISource("pb_221.avi",false) Trim(0,19) ++\ Trim(20,0).xlogo("logo221_x_540_y_300_2.bmp", X=540, Y=300, alpha=0) LanczosResize(720,480)
The first parameter is the logo mask BMP file, X and Y the positions again, and alpha=0 indicates a solid logo.
There are other parameters explained in the readme if you want to experiment, but I find the defaults are fine.
Open in VirtualDub to check.
You may see this error message:
This means there is a problem with the bitmap. First make sure the "black" surrounding the white logo shape is really black; if not, make it so. If you still get the error, it can also be caused by having the white mask too close to an edge. Enlarge the BMP to give some more black space around the logo (if you add pixels to the top or left, remember this will change the effective (x,y) position, and thus the name of the file and parameters in the function call).
If you see some remnant of the logo colour after filtering, enlarge the white mask a bit (just use paintbrush) in the affected area and try again.
Smooth areas of colour are almost perfectly repaired.
Very busy and detailed areas aren't so successful.
Note that some detail is restored here.
The alpha parameter
The previous example was solid colour -- the following has a little alpha transparency, not pure white as it at first appears.
(Notice the window frame visible through the logo).
Making a logo bitmap and using the parameters as for solid colour, we see a dark shadow on many of the frames after applying xLogo.
xlogo("logo106_x_400_y_322_2.bmp", X=400, Y=322, alpha=0)
xlogo("logo106_x_400_y_322_2.bmp", X=400, Y=322, alpha=20)
xlogo("logo106_x_400_y_322_2.bmp", X=400, Y=322, alpha=30)
xlogo("logo106_x_400_y_322_2.bmp", X=400, Y=322, alpha=40)
As alpha increases the filtered logo area gets increasingly white.
Here I chose alpha=20 as the best compromise.
You could use the VirtualDub script editor for finding the optimum value, but I found the Avisynth script editor Avsp more convenient.
In this I used a slider for alpha:
xlogo("logo106_x_400_y_322_2.bmp", X=400, Y=322, alpha=[<"alpha", 0, 255, 10>])
And could quickly look at various frames with different alpha settings in different tabs.
+ Reply to Thread
Results 1 to 30 of 35
Last edited by AlanHK; 11th Apr 2016 at 00:47.
Originally Posted by sumeshkri
thanks alanhk. but evennow my
now problem has not yet solved. i wanted to remove the text upon the video. it is not the logo i am talking about.
Originally Posted by sumeshkri
I am total newbee and will ask for help. I have a iso file dvd movie and i will remove some russian subs wich are hardsubs. i reed that you can xlogo. Is there somewhere a total step by step guide for someone like me or a nice person who can learn me the magic?? pls help....
Originally Posted by bigboy77
And so you need these, and you need to extract whatever kind of video you have in the ISO to a video file.
Xlogo would need a large mask area to do this, one covering the maximum area used by subtitles.
Maybe VirtualDub MSU Subtitle Remover would be better, I haven't used that myself though.
Hi jagabo. I have read the guide maybe 10 times..... I can get it in my head about this point in the guide:
(# Make detection pass on video - 3rd button on the panel, "Go with playback". Bright white pixels represents found subtitles. Correct your settings and return to prevous step, if nessesary.
# Check "2nd pass" in the filter settings window.
# With "Go with playback" button you can check removing results. Bright white pixels represents found subtitles. Correct your settings and return to prevous step, if nessesary. )
3rd button on the panel which i dont know where are and on which panel??
The guide is not so usefull..... Maybe some one else have another guide which gives a better understanding how you use the MSU Subtittle remover...
THANKS FOR THIS EXCELLENT TUTORIAL.
Yeah!!! I have done almost......but got an error...
I have made the masked logo as you saiid.it is----
name is "logo221_x_252_y_8_2.bmp"
here is the two screenshot with the script
I got the error
I think your blacks aren't black enough.
You didn't blacken them enough. They are not black. At least in the JPG file you posted.
Well, the image you attached wasn't 100% black.
Look at the "Info" palette and when you move the cursor over a point it will tell you the RGB.
Black should be 0,0,0. Your image has values like 10,10,8.
And White should be all 255,255,255
Simple way to be sure is to select the "black" area (use the magic wand, or draw a marquee), then "fill" and choose "black".
Then Select/Inverse and fill the rest with white.
-- That assumed using Photoshop, but your PIXELFORMER, I don't know.
I see that it has a "bit depth" setting. So try just one bit; b/w, no greys.
Last edited by AlanHK; 16th Feb 2011 at 11:14.
okay,then there is no error in script,only in that image.
I have used PIXELFORMER software(bitmap editor) to blacken the side pixels and saved in bmp,then the software or I might be wrong.
then I have to use PHOTOSHOP.Is there any other program than PHOTOSHOP?
Last edited by AlanHK; 16th Feb 2011 at 11:30.
thanks to you very much.
actually the static logo in my video has bigger size,so I may haven't get that much blurring effect as in the tutorial.Are there any settings(which I don't know)or any filter for fulfill my purpose?
I don't think there's much else you can do other than manually editing each frame of the video.
You can still see the logo, or there is too much blurring after it is removed?
If the first, you enlarge the white part of the mask a couple of pixels all around. You might have to increase the black border as well if it's too thin.
If the latter; well, you can't recreate the original , the filter just extrapolates from the edges in.
My problem has been solved.
THANKS TO ALL!!!!
Last edited by rijubrata; 17th Feb 2011 at 04:38.
is it possible to use xlogo in megui? if possible can u pls give me example script for this video....
Last edited by poluhale2; 4th Oct 2012 at 03:24.