Skip to content

Python script for premultiplying alpha channel for images in bulk

Notifications You must be signed in to change notification settings

zteffi/Premultiply-Alpha-in-Folder

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

8 Commits
 
 
 
 

Repository files navigation

Premultiply-Alpha-in-Folder

Make sure you have backup of the folder, since this tool rewrites all the images!

Python script that recursively premultiplies rgb values by alpha for all .png images in a folder, i.e.:

pixel_in = (r,g,b,a)
pixel_out = (r * a, g * a, b * a)

Installing dependencies

You need python and pip installed. Then just run

sudo pip install Pillow 

Usage

$python Premultiply.py images

where images is the root folder, with subfolder

$python Premultiply.py 'images folder'

Use apostropes if the folder name contains spaces

About

Python script for premultiplying alpha channel for images in bulk

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages