FANDOM


Copypasted from google cache.

Original URL: http://at2.limitedwish.railsplayground.net/pmwiki.php/Main/AddAlphaToShatterImage


Add Alpha To Shatter Image

While editing one of the cosmosphere movies, we wanted to extract a "window shattering" effect from the original movie, and superimpose that over a new movie.

However, that proved problematic as the shatter image didn't have alpha, and it was complex to edit in Photoshop. Wizzardx wrote a quick Python utility to help add alpha by analysing each pixels brightness.

From the original post, here here:

A bit more complicated than changing black pixels alpha to 0 (that looked really bad). Basically taking all the dark pixels (with R,G, and B below 100), and using the average of their R,G,and B values for alpha.

Here's the script so you can try it yourself. It should be easy to tweak so you can try different things:

http://m0hr.com/uploads/weezy.freeforums.org/add_alpha_to_shatter_images.py

Usage:

1) Install python and pygame (see my previous readme)

2) Copy your png files to a subdirectory (under script location) called "input"

3) Create a directory called "output"

4) Run the script

The script will create a series of TGA files with alpha (pygame limitation), but you can convert those to PNG easily.

Ad blocker interference detected!


Wikia is a free-to-use site that makes money from advertising. We have a modified experience for viewers using ad blockers

Wikia is not accessible if you’ve made further modifications. Remove the custom ad blocker rule(s) and the page will load as expected.