Use this module to apply a number of blending modes to a background and foreground image
Project description
BlendModes
Use this module to apply a number of blending modes to a background and foreground image.
Credits
Credits to:
MIT License Copyright (c) 2019 Paul Jewell
For implementing blending from the Open Raster Image Spec
MIT License Copyright (c) 2018 Addison Elliott
For implementing blending from Paint.NET
MIT License Copyright (c) 2017 pashango
For implementing a number of blending functions used by other popular image editors
- Credits
- Examples
- Documentation
- Install With PIP
- Language information
- Install Python on Windows
- Install Python on Linux
- How to run
- Download Project
- Community Files
Examples
Be sure to include the following for the functions below
from blendmodes.blend import blendLayers, BlendType
background = Image.open(THISDIR + "/background.png")
foreground = Image.open(THISDIR + "/foreground.png")
Normal
blendLayers(background, foreground, BlendType.NORMAL)
Multiply
blendLayers(background, foreground, BlendType.MULTIPLY)
Additive
blendLayers(background, foreground, BlendType.ADDITIVE)
ColourBurn
blendLayers(background, foreground, BlendType.COLOURBURN)
ColourDodge
blendLayers(background, foreground, BlendType.COLOURDODGE)
Reflect
blendLayers(background, foreground, BlendType.REFLECT)
Glow
blendLayers(background, foreground, BlendType.GLOW)
Overlay
blendLayers(background, foreground, BlendType.OVERLAY)
Difference
blendLayers(background, foreground, BlendType.DIFFERENCE)
Negation
blendLayers(background, foreground, BlendType.NEGATION)
Lighten
blendLayers(background, foreground, BlendType.LIGHTEN)
Darken
blendLayers(background, foreground, BlendType.DARKEN)
Screen
blendLayers(background, foreground, BlendType.SCREEN)
XOR
blendLayers(background, foreground, BlendType.XOR)
SoftLight
blendLayers(background, foreground, BlendType.SOFTLIGHT)
HardLight
blendLayers(background, foreground, BlendType.HARDLIGHT)
GrainExtract
blendLayers(background, foreground, BlendType.GRAINEXTRACT)
GrainMerge
blendLayers(background, foreground, BlendType.GRAINMERGE)
Divide
blendLayers(background, foreground, BlendType.DIVIDE)
Hue
blendLayers(background, foreground, BlendType.HUE)
Saturation
blendLayers(background, foreground, BlendType.SATURATION)
Colour
blendLayers(background, foreground, BlendType.COLOUR)
Luminosity
blendLayers(background, foreground, BlendType.LUMINOSITY)
PinLight
blendLayers(background, foreground, BlendType.PINLIGHT)
VividLight
blendLayers(background, foreground, BlendType.VIVIDLIGHT)
Exclusion
blendLayers(background, foreground, BlendType.EXCLUSION)
DestIn
blendLayers(background, foreground, BlendType.DESTIN)
DestOut
blendLayers(background, foreground, BlendType.DESTOUT)
DestAtop
blendLayers(background, foreground, BlendType.DESTATOP)
SrcAtop
blendLayers(background, foreground, BlendType.SRCATOP)
Documentation
See the Docs for more information.
Install With PIP
pip install blendmodes
Head to https://pypi.org/project/blendmodes/ for more info
Language information
Built for
This program has been written for Python 3 and has been tested with Python version 3.9.0 https://www.python.org/downloads/release/python-380/.
Install Python on Windows
Chocolatey
choco install python
Download
To install Python, go to https://www.python.org/ and download the latest version.
Install Python on Linux
Apt
sudo apt install python3.9
How to run
With VSCode
- Open the .py file in vscode
- Ensure a python 3.9 interpreter is selected (Ctrl+Shift+P > Python:Select Interpreter > Python 3.9)
- Run by pressing Ctrl+F5 (if you are prompted to install any modules, accept)
From the Terminal
./[file].py
Download Project
Clone
Using The Command Line
- Press the Clone or download button in the top right
- Copy the URL (link)
- Open the command line and change directory to where you wish to clone to
- Type 'git clone' followed by URL in step 2
$ git clone https://github.com/FHPythonUtils/BlendModes
More information can be found at https://help.github.com/en/articles/cloning-a-repository
Using GitHub Desktop
- Press the Clone or download button in the top right
- Click open in desktop
- Choose the path for where you want and click Clone
More information can be found at https://help.github.com/en/desktop/contributing-to-projects/cloning-a-repository-from-github-to-github-desktop
Download Zip File
- Download this GitHub repository
- Extract the zip archive
- Copy/ move to the desired location
Community Files
Licence
MIT License (See the LICENSE for more information.)
Changelog
See the Changelog for more information.
Code of Conduct
Online communities include people from many backgrounds. The Project contributors are committed to providing a friendly, safe and welcoming environment for all. Please see the Code of Conduct for more information.
Contributing
Contributions are welcome, please see the Contributing Guidelines for more information.
Security
Thank you for improving the security of the project, please see the Security Policy for more information.
Support
Thank you for using this project, I hope it is of use to you. Please be aware that those involved with the project often do so for fun along with other commitments (such as work, family, etc). Please see the Support Policy for more information.
Rationale
The rationale acts as a guide to various processes regarding projects such as the versioning scheme and the programming styles used. Please see the Rationale for more information.
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Hashes for blendmodes-2021.2-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 5288c29581033feb9e25eed9a83b1d91a92107643dfe399a8a5b8b1f7156835b |
|
MD5 | 5c0dbf5910ef3f0f5670a654bbb88ca9 |
|
BLAKE2b-256 | e099f84276790ebc64e22f9ddac88e44e245e581936089b6f646a2485b69bc36 |