Welcome Guest ( Log In | Register )


Important

The forums will be closing permanently the weekend of March 15th. Please see the notice in the announcements forum for details.

 
There Is No Quality Logo Filters...
« Next Oldest | Next Newest » Track this topic | Email this topic | Print this topic
Stranger
  Posted: Oct 16 2002, 01:48 AM


Unregistered









Hi All,

Processing my videos I use freeware and really powerful VirtualDub. When I started placing a logo on my videos, I thought that it would be an easy task. Donald Graft's Logo Filter for VirtualDub was the first and the last filter that I have found on the net. But after I had a look at the results of blending my logo to the video, I was very upset . There was NO antialiasing, the logo had ugly edges with discrete pixels...

I have faced the problem that on the Internet there is NO quality VirtualDub's filters for placing a logo on a video. It's full of programs for video processing that can qualitatively carry out this task, but no similar filter for the VirtualDub, too bad. I wonder why?

It's time to write such filter. As I understand so far, there are source codes that require some completion so that it would be possible to load an alpha channel mask saved as grayscale image or as image with alpha mask layer in proper formats..

About a month ago I sent that message to Donald Graft, Karel Suhajda and some other filter developers.

Here is Mr.Graft’s answer:

"Use a graphics package to render your antialiased text or logo. Then apply the resulting BMP using logo."

I wrote him back, that I didn’t see any meaning in this phrase, because there wouldn’t be any antialiasing anyway, if you use the Logo Filter with alpha value only for one color.

Well, Mr.Graft is kind of a thorny guy, because his answer was that he was not going to change anything in his filter.

Mr.Karel Suhajda turned out to be nice guy and here is his answer:

"I don't know any such filter but I can recommend you a method how to do it with the current Logo filter. Make the logo bigger, e.g. 4 times in each direction. Then, in the VirtualDub Filters, put the following sequence:

Resize - enlarge the video 4 times in each direction
Logo - add enlarged logo to the enlarged video
Resize - shrink the video back to its original size (don't use Nearest neighbor!!!)
Sharpen - sharpen the video a little as the previous process slightly blurred it

This way, you'll get pseudo-antialiasing which may be sufficient for you for the cost of additional processing.

Creating a Logo filter with alpha mask shouldn't be a big problem but I am not going to create one in a near future.

You may also try to contact Donald Graft at http://shelob.mordor.net/dgraft/ as he is the Logo author and he could add the alpha mask to the Logo filter with the least effort.

With regards,

Karel
"

Thanks to him, but unfortunately this way grabs away too much of computing resources does not prove the expectations.

For example, you can’t rich an effect of a mild shade smoothly falling off over to transparency under the logo, as shown in the picture below. There is no VD filter for such results sad.gif

user posted image user posted image

That’s what happens with the Logo v1.3 filter - notice discrete of pixels on the edges.

user posted image

Logo filter after image scaling with pseudo-antialiasing - not bad, but not as good as needed and the computing resources are killing way.

user posted image

VD's filters developers fill the gap, PLEASE!!!

If anyone takes the challenge, leave a message…

Thanks

--
Best Regards,
Stranger
 
  Top
fccHandler
Posted: Oct 16 2002, 02:45 AM


Administrator n00b


Group: Moderators
Posts: 3961
Member No.: 280
Joined: 13-September 02



I second the motion. But how do you provide the alpha channel to the filter? Would it have to be a separate bitmap? How about a really fancy logo filter that could import .png, or even a PhotoShop .psd?

...just some thoughts biggrin.gif

--------------------
May the FOURCC be with you...
 
     Top
Spire
Posted: Oct 16 2002, 04:37 AM


Unregistered









Since Mr. Graft has provided the source code for his logo filter, alpha channel support might not be too hard to implement, by way of having the user provide a second .BMP file that contains the alpha channel. I'll try to look into it tonight if time permits. No promises, though!

And no fancy .PNG or .PSD format support for now, either. biggrin.gif
 
  Top
Neo Neko
Posted: Oct 16 2002, 04:52 AM


VirtualdubMod Alpha tester


Group: Vdubmod Alpha Testing Team
Posts: 474
Member No.: 24
Joined: 11-July 02



Actually PNG is a much superior format to BMP. A 32bit RGBA BMP will be huge, relatively hard to create right, and unrecognisable by most programs that read BMP. However a 16bit PNG compressed with an alpha channel is no sweat. And you could use easily avalible free libraries to write it to boot. Hell you could splurge and go for a 24bit PNG with alpha. I agree PSD is useless here. That is why no one suggested to use it.

PNG is everywhere. The only place people refrain to impliment it is in the backwards Windows world. Almost everyone has better PNG support than Microsoft.
 
     Top
Spire
Posted: Oct 16 2002, 05:12 AM


Unregistered









I know .PNG is superior to .BMP. Heck, pretty much anything is superior to .BMP in almost every way. But when it comes to quick & dirty implementation in Windows, nothing beats .BMP, simply because it is the native Windows image format, directly supported by Windows API calls.

When implementing image support in a Windows program, it only makes sense to do .BMP first, since it is already so close to the internal bitmap format that Windows already uses. Once .BMP is working, one then has the option to implement .PNG, .TIF, GIF, .JPG, or whatever else is desired.

I might potentially want to implement .PNG support, but I would never do so without first implementing .BMP support.

(On a side note: I noticed that you said that you "agree that PSD is useless here". I don't know whom you're agreeing with, as I don't see any post here that claims it would be useless. I think it might actually be marginally useful to some people, but IMO the intricacies of this proprietary format are way too complicated to be worth the trouble -- at least for now. You also said that no one suggested .PSD, but in fact, fccHandler is the one who brought it up in the first place by suggesting it in his post above.)
 
  Top
phaeron
Posted: Oct 16 2002, 05:42 AM


Virtualdub Developer


Group: Administrator
Posts: 7773
Member No.: 61
Joined: 30-July 02



An alpha-capable logo filter is in 1.4.11 beta -- it accepts TGA or BMP, alpha bundled or separate, premultiplied or not. It could use some testing, so drop me a line by email if you are willing to bang on it over the next few days or so.
 
    Top
Spire
Posted: Oct 16 2002, 01:55 PM


Unregistered









Avery was kind enough to send me a prelease build of VirtualDub 1.4.11 with the new logo filter, and I'm happy to report that it has both BMP and Targa support.

While testing the logo filter, I discovered that it's not very easy to produce proper Targa files with alpha transparency using Adobe Photoshop. When Photoshop saves a Targa file, it does not properly convert layer transparency into an alpha channel. Manually duplicating the transparency channel into an an explicit alpha channel isn't enough either, since the image itself must be blended against black.

In anticipation of the release of VirtualDub 1.4.11, to simplify VirtualDub logo exporting for Photoshop users, I've created a Photoshop action (.ATN) script to do it automatically. Here are instructions for its use:

This Adobe Photoshop action exports an image to a Targa file with an alpha transparency channel, suitable for use with the logo filter built into VirtualDub 1.4.11 and later. It was created using Adobe Photoshop 7.x; it may or may not work with earlier versions. At the time of this writing, VirtualDub 1.4.11 is not yet available to the general public; information contained here about the way it works should be considered preliminary and subject to change.

To use the action, first create your logo in Photoshop in RGB Color mode. You can use as many layers, layer masks, and layer effects as you want, but you must not have a Background layer. If you do have a Background layer, you must delete it before running the action; merely hiding it is not enough. (However, you can hide layers other than the Background layer if you don't want them included in the exported logo.)

Additionally, you must have no saved selections or other alpha channels listed under the Channels palette, except for layer masks, which are okay. If there are any others, you must delete them before running the action.

When you're ready to export the logo, simply run the action, and it will do all the work automatically for you. When prompted, enter a filename for the logo, and click Save. The Targa Options must be set to 32 bits/pixel; RLE compression is optional but recommended.

Because this action works on a copy of your logo rather than original, it is completely nondestructive.

When you're done exporting the file, load it in VirtualDub's logo filter, and enable Alpha blending. Note that you should not enable the "Use non-premultiplied alpha" setting, because the Targa file produced with this action has premultiplied alpha.

That's all! Hope you folks enjoy this Photoshop action when VirtualDub 1.4.11 is released. Creating it was easier than implementing alpha support in Donald Graft's filter. biggrin.gif
 
  Top
ChristianHJW
Posted: Oct 16 2002, 03:09 PM


Advanced Member


Group: Moderators
Posts: 1768
Member No.: 2
Joined: 7-July 02



Great work guys !

--------------------
Visit the unofficial Virtualdub support forum on http://forums.virtualdub.org - help to reduce the big number of emails Avery Lee is getting every day !!
Support matroska as container and Gstreamer as the only truely open, x-platform multimedia platform ....
 
       Top
Stranger
  Posted: Oct 17 2002, 08:58 AM


Unregistered









Mr.Avery Lee has graciously sent me the beta. Everything works fine in my case. IMHO, for the present moment the logo filter is in initial state with regard to the interface, and lacks the animation abilities. (I remember… 'One thing at a time' rolleyes.gif).

So finally it has proved expectations! BTW, a translucency slider suggest itself in the logo interface, because doing it with the help of an alphamask is a really boring process.

Great thanks to phaeron for the changings in the logo filter.

--
Best Regards,
Stranger
 
  Top
Neo Neko
Posted: Oct 17 2002, 02:15 PM


VirtualdubMod Alpha tester


Group: Vdubmod Alpha Testing Team
Posts: 474
Member No.: 24
Joined: 11-July 02



Well if we were using PNG the Targa or BMP transparency support would not be a problem. Even with native Windows API calls IIRC 32bit RGBA bitmaps are well neigh impossible to load. And targa is not a Windows API supported format either IIRC. So much for the quick and dirty hack. I am glad to hear Avery has been working on it though. I came up with my own solution using avisynth. I had some music videos I was recovering from VHS which had nice constant MTV logo rape for "Spring Break 99"". I simply cut and paste a frame with the logo into photoshop. I then proceded to construct my logo on top of the MTV one. Once the logo was done I used it to create a quick grayscale mask to use with the logo. I saved both the logo and mask as 24bit bmp files. I opened each bmp separatly in virtualdub and saved them as 1 frame MJPEG AVI files. Then came the wicked Avisynth voodoo like this.

loadplugin("./avs/decomb.dll")
logo=avisource("logo.avi").converttoyuy2()
mask=avisource("mask.avi").converttoyuy2()
video=avisource("CAPTURE.AVI").trim(77,6183).fielddeinterlace().temporalsoften(2,6,16).normalize
video=video.layer(mask,"darken",255)
video=video.layer(logo,"lighten",255)
return video

To speed things up a bit I could have converted both logo.avi and mask.avi to yuy2 and saved them so I don't have to convert them everytime the script is run. I think I will seeing as how I am going to be using em for a while longer. The result was just superb though. A nice spiffy logo with perfect alpha blending! All in all there was not a massive performance hit even with all the filtering.

If anyone cares to see a scaled down 36mb version of the video it is at http://interface.darktech.org/files/cassius.avi

 
     Top
Hypatian
Posted: Oct 22 2002, 03:22 AM


Unregistered









The new 1.4.11 logo filter is very nice. I look forward to a possible future version with animation support. (That's where my primary problems showed up--making overlays with dgraft's logo filter can be difficult because previewing the effect rarely works properly. I spent about two hours trying to get it right today, only to fall back on avisynth in frustration.)

I've also used avisynth for this sort of effect, though my code is slightly different. I actually use dgraft's logo filter on top of a blank image to produce overlay and mask .avi files, like so:

BlankClip(87)
Logo(animate=true, filename="...0000.bmp")

and save these out using virtualdub as an intermediate step. Then I recombine like so:

source=AVISource(...)
overlay=AVISource(...)
overlay_mask=AVISource(...)
target = layer(source, overlay.mask(overlay_mask), op="add")

The "mask" function adds an alpha channel to a clip by converting the mask clip to grayscale. It requires you to be working on RGB32 clips, though, so I may try the darken/lighten approach.
 
  Top
Neo Neko
Posted: Oct 22 2002, 04:46 AM


VirtualdubMod Alpha tester


Group: Vdubmod Alpha Testing Team
Posts: 474
Member No.: 24
Joined: 11-July 02



QUOTE (Hypatian @ Oct 21 2002, 09:22 PM)
The "mask" function adds an alpha channel to a clip by converting the mask clip to grayscale. It requires you to be working on RGB32 clips, though, so I may try the darken/lighten approach.

I tried the mask function. But it was a massive performace hit. Even with the mask.avi and logo.avi already RGB. Converting the actual YUY cap to RGB and then back to YUY on a 640x480 rez file droped the frame encoding rate to 5~7Fps. With all the clips in YUY and using the darken lighten method I would get anywhere from 11~22fps. The more times you convert color spaces the more quality you loose as well as CPU power. I recently did a test with an animated logo and it worked like a charm.
 
     Top
Morsa
Posted: Oct 22 2002, 04:52 AM


Moderator of the Vdub support board


Group: Moderators
Posts: 640
Member No.: 246
Joined: 9-September 02



Question, Neo Neko:
What kind of quality degradation are you talking about with color space convertions???
Please, I want to know more.

So Avery implemented TGA support???
Why didn´t use PNG?


 
     Top
Hypatian
Posted: Oct 22 2002, 09:06 PM


Unregistered









QUOTE (Morsa @ Oct 22 2002, 12:52 AM)
What kind of quality degradation are you talking about with color space convertions???

So Avery implemented TGA support???
Why didn´t use PNG?

Converting between colorspaces always loses information, since different colorspace cover different portions of the "real" color space (gamuts), and have different color resolutions in different areas as well. If possible, avoid changing colorspaces as much as possible. smile.gif

Why TGA (targa) instead of PNG: PNG requires using an external library. Targa format, on the other hand, is bog-simple. So, supporting targa is trivial, and PNG is more pain. I would like to see PNG support, but Targa is good enough.

The Gimp, by the way, does output alpha-channel targas that the 1.4.11 logo filter can use happily.
 
  Top
Morsa
Posted: Oct 22 2002, 10:16 PM


Moderator of the Vdub support board


Group: Moderators
Posts: 640
Member No.: 246
Joined: 9-September 02



Well, now virtualdubAVS&OGM has PNG import/export.
No transparency yet.
 
     Top
1 User(s) are reading this topic (1 Guests and 0 Anonymous Users)
0 Members:
14 replies since Oct 16 2002, 01:48 AM Track this topic | Email this topic | Print this topic

<< Back to VirtualDub Development Forum