Welcome to Doom9's Forum, THE in-place to be for everyone interested in DVD conversion.

Before you start posting please read the forum rules. By posting to this forum you agree to abide by the rules.


Go Back   Doom9's Forum > General > Newbies

Thread Tools Search this Thread Display Modes
Old 24th July 2008, 23:50   #1  |  Link
Registered User
MrLabRat's Avatar
Join Date: Jul 2008
Posts: 1

I'm using DVD GUI to write .AVS files.
I am trying to tweak it once I have the .AVS exported.
One thing I am trying to do is apply a nice looking DropShadow to my moving images. If you know a way please post it.

########## Below is my crappy example of what I am trying to do in an .AVS file.

YOU MIGHT WANT TO COPY AND PASTE INTO AN EDITOR. IT has comments as to what I am thinking.

#### BEGIN CODE #####
# Variables
img = ImageSource("C:\MyImage") # Image
msk = ImageSource("C:\MyMask") # Mask

# My function being called.
img = ImgDrpShdw(img, msk)
# The guts of this function are shown below.

# of course there is a ton of code missing, and if you are familiar with DVD GUI you are familiar with the generic "img" variable
#img gets returned inside of the KenBurns zoom function, there is also a moving background that I am leaving out of this example.

# this is the function i wrote in an attempt to apply a Drop shadow to my Animated Image.

function ImgDrpShdw (clip a, clip b)
# clip a is intended to be main image.
#clip b is intended to be mask.
# Width and Height set to Main Image - Main Image changes it's dimensions throughout the slideshow
W = width(a)
H = height(a)
# has to be converted to RGB32 or it won't work
a = a.ConvertToRGB32()
# mask changed to fit Main clip.
b = b.BilinearResize(W, H).ConvertToRGB32()
# my attempt at a transparent BG
transBG = blankclip(width=W, height=H, color=$000000)
# This removes the color black, and of course the blankclip is black.
transBG = resetmask(transBG).colorkeymask($000000, 128)
#Overlay Image with mask and transBG
msk = overlay(transBG, a, mask=b, mode="blend")
return msk

##### END CODE #####

That is it... i have been doing this for two whole days... nothing seems to work. So i broke down and decided to post on this forum. If you can help I would appreciate it.
MrLabRat is offline   Reply With Quote
Old 25th July 2008, 21:34   #2  |  Link
Avisynth language lover
Join Date: Dec 2007
Location: Spain
Posts: 3,433
It's not clear from your post what form your mask image takes.
Assuming that it's actually an alpha channel transparency mask, then you need to change these lines
msk = ImageSource("C:\MyMask")
b = b.BilinearResize(W, H).ConvertToRGB32()
msk = overlay(transBG, a, mask=b, mode="blend")
to these:
msk = ImageSource("C:\MyMask", pixel_type="RGB32")
b = b.BilinearResize(W, H)
msk = overlay(transBG, a, mask=b.ShowAlpha, mode="blend")
This is because:
- ImageSource defaults to RGB24
- Overlay does not use the alpha channel explicitly, you have to use ShowAlpha

Last edited by Gavino; 25th July 2008 at 21:37.
Gavino is offline   Reply With Quote

animated, avs, drop shadow, dropshadow, image

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump

All times are GMT +1. The time now is 16:04.

Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2024, vBulletin Solutions Inc.