[Author Prev][Author Next][Thread Prev][Thread Next][Author Index][Thread Index]

Re: [pygame] Fade in/out transition effect



> psymaster@caths.co.uk wrote:
>> I have written a program that does a slideshow, but I want to make the
>> transition softer, and I want to do this by fading between the two
>> images.
>> Anybody can point me to more info about how this can be done in pygame?
>
> You can set the image alpha value to something like 20 and blit it several
> times. This won't be entirely fast but it gives you a decent fade speed.
> Eventually you should blit the 'opaque' version of the image so you are
> really seeing the right thing. This will be pretty slow, so be careful.
> Perhaps give the transition a time limit, so if the transparent blits are
> slow it will only do 1 or 2 in between steps.
>
> I'd recommend using some simple "wipe" effects where you just draw
> sections
> of the image from the top down. This will run fast and easy. No
> performance
> problems on the slowest of platforms.
>
>

I did this and it works pretty well now, and it isn't that slow. My only
problems right now is not from pygame but from PIL, which raises
exceptions sometimes when it doesn't like the image it is loading, for
ridiculous reasons like 3 bytes missing. Anybody can recommend other
libraries that will let me do high-quality resizing?