Handy when working with icons, like this one:
Make sure python/python3 and pip/pip3 are installed and install Pillow
$ pip install Pillow
or use pip3
.
Changes the opacity of the image multiplying the alpha channel of each pixel for the specified value.
Example:
$ python opacity.py img.png 0.4
Changes the color of the image to the specified RGB value keeping the alpha unchanged.
Example:
$ python tint.py img_opacity_0.4.png 10 20 200
Transforms the colors of the image to their negative, alpha unchanged.
Example:
$ python negative.py img_opacity_0.4_tinted.png
(img_opacity_0.4_tinted_negative.png)
Inverts the opacity of an image.
Examples:
$ python invert.py img_opacity_0.4_tinted.png
(img_opacity_0.4_tinted_inverted.png)
$ python invert.py img.png
Converts the white pixels of an image to transparent ones
Example:
$ python white_to_transparent.py img_white.png
You can process more images at the same time
Examples:
Change the opacity of 'img.png' and 'img2.png'
$ python opacity.py img.png img2.png 0.4
Change the opacity of all the png files in the 'icons' folder
$ python opacity.py icons/*.png 0.4