|
Metadata-Version: 2.1 |
|
Name: blendmodes |
|
Version: 2022 |
|
Summary: Use this module to apply a number of blending modes to a background and foreground image |
|
Home-page: https://github.com/FHPythonUtils/BlendModes |
|
License: MIT |
|
Author: FredHappyface |
|
Requires-Python: >=3.8,<4.0 |
|
Classifier: Development Status :: 5 - Production/Stable |
|
Classifier: Intended Audience :: Developers |
|
Classifier: Intended Audience :: Education |
|
Classifier: License :: OSI Approved :: MIT License |
|
Classifier: Natural Language :: English |
|
Classifier: Operating System :: OS Independent |
|
Classifier: Programming Language :: Python :: 3 |
|
Classifier: Programming Language :: Python :: 3.10 |
|
Classifier: Programming Language :: Python :: 3.8 |
|
Classifier: Programming Language :: Python :: 3.9 |
|
Classifier: Programming Language :: Python :: Implementation :: CPython |
|
Classifier: Topic :: Multimedia :: Graphics |
|
Classifier: Topic :: Software Development :: Libraries :: Python Modules |
|
Classifier: Topic :: Utilities |
|
Requires-Dist: Pillow (>=9.0.0,<10) |
|
Requires-Dist: aenum (>=3.1.7,<4) |
|
Requires-Dist: deprecation (>=2.1.0,<3) |
|
Requires-Dist: numpy (>=1.22.1,<2) |
|
Project-URL: Documentation, https://github.com/FHPythonUtils/BlendModes/blob/master/README.md |
|
Project-URL: Repository, https://github.com/FHPythonUtils/BlendModes |
|
Description-Content-Type: text/markdown |
|
|
|
[![GitHub top language](https://img.shields.io/github/languages/top/FHPythonUtils/BlendModes.svg?style=for-the-badge)](../../) |
|
[![Repository size](https://img.shields.io/github/repo-size/FHPythonUtils/BlendModes.svg?style=for-the-badge)](../../) |
|
[![Issues](https://img.shields.io/github/issues/FHPythonUtils/BlendModes.svg?style=for-the-badge)](../../issues) |
|
[![License](https://img.shields.io/github/license/FHPythonUtils/BlendModes.svg?style=for-the-badge)](/LICENSE.md) |
|
[![Commit activity](https://img.shields.io/github/commit-activity/m/FHPythonUtils/BlendModes.svg?style=for-the-badge)](../../commits/master) |
|
[![Last commit](https://img.shields.io/github/last-commit/FHPythonUtils/BlendModes.svg?style=for-the-badge)](../../commits/master) |
|
[![PyPI Downloads](https://img.shields.io/pypi/dm/blendmodes.svg?style=for-the-badge)](https://pypistats.org/packages/blendmodes) |
|
[![PyPI Total Downloads](https://img.shields.io/badge/dynamic/json?style=for-the-badge&label=total%20downloads&query=%24.total_downloads&url=https%3A%2F%2Fapi.pepy.tech%2Fapi%2Fprojects%2Fblendmodes)](https://pepy.tech/project/blendmodes) |
|
[![PyPI Version](https://img.shields.io/pypi/v/blendmodes.svg?style=for-the-badge)](https://pypi.org/project/blendmodes) |
|
|
|
<!-- omit in TOC --> |
|
|
|
|
|
<img src="readme-assets/icons/name.png" alt="Project Icon" width="750"> |
|
|
|
Use this module to apply a number of blending modes to a background and |
|
foreground image. |
|
|
|
|
|
|
|
Credits to: |
|
|
|
|
|
|
|
For implementing blending from the Open Raster Image Spec |
|
|
|
|
|
|
|
For implementing blending from Paint.NET |
|
|
|
|
|
|
|
For implementing a number of blending functions used by other popular image |
|
editors |
|
|
|
- [Credits]( |
|
- [MIT License Copyright (c) 2019 Paul Jewell]( |
|
- [MIT License Copyright (c) 2018 Addison Elliott]( |
|
- [MIT License Copyright (c) 2017 pashango]( |
|
- [Examples]( |
|
- [Normal]( |
|
- [Multiply]( |
|
- [Additive]( |
|
- [ColourBurn]( |
|
- [ColourDodge]( |
|
- [Reflect]( |
|
- [Glow]( |
|
- [Overlay]( |
|
- [Difference]( |
|
- [Negation]( |
|
- [Lighten]( |
|
- [Darken]( |
|
- [Screen]( |
|
- [XOR]( |
|
- [SoftLight]( |
|
- [HardLight]( |
|
- [GrainExtract]( |
|
- [GrainMerge]( |
|
- [Divide]( |
|
- [Hue]( |
|
- [Saturation]( |
|
- [Colour]( |
|
- [Luminosity]( |
|
- [PinLight]( |
|
- [VividLight]( |
|
- [Exclusion]( |
|
- [DestIn]( |
|
- [DestOut]( |
|
- [DestAtop]( |
|
- [SrcAtop]( |
|
- [Documentation]( |
|
- [Install With PIP]( |
|
- [Language information]( |
|
- [Built for]( |
|
- [Install Python on Windows]( |
|
- [Chocolatey]( |
|
- [Windows - Python.org]( |
|
- [Install Python on Linux]( |
|
- [Apt]( |
|
- [Dnf]( |
|
- [Install Python on MacOS]( |
|
- [Homebrew]( |
|
- [MacOS - Python.org]( |
|
- [How to run]( |
|
- [Windows]( |
|
- [Linux/ MacOS]( |
|
- [Download Project]( |
|
- [Clone]( |
|
- [Using The Command Line]( |
|
- [Using GitHub Desktop]( |
|
- [Download Zip File]( |
|
- [Community Files]( |
|
- [Licence]( |
|
- [Changelog]( |
|
- [Code of Conduct]( |
|
- [Contributing]( |
|
- [Security]( |
|
- [Support]( |
|
- [Rationale]( |
|
|
|
|
|
|
|
Be sure to include the following for the functions below |
|
|
|
```python |
|
from blendmodes.blend import blendLayers, BlendType |
|
|
|
background = Image.open(THISDIR + "/background.png") |
|
foreground = Image.open(THISDIR + "/foreground.png") |
|
``` |
|
|
|
|
|
|
|
```python |
|
blendLayers(background, foreground, BlendType.NORMAL) |
|
``` |
|
|
|
![Normal](test/data/normal_expected.png) |
|
|
|
|
|
|
|
```python |
|
blendLayers(background, foreground, BlendType.MULTIPLY) |
|
``` |
|
|
|
![Multiply](test/data/multiply_expected.png) |
|
|
|
|
|
|
|
```python |
|
blendLayers(background, foreground, BlendType.ADDITIVE) |
|
``` |
|
|
|
![Additive](test/data/additive_expected.png) |
|
|
|
|
|
|
|
```python |
|
blendLayers(background, foreground, BlendType.COLOURBURN) |
|
``` |
|
|
|
![ColourBurn](test/data/colourburn_expected.png) |
|
|
|
|
|
|
|
```python |
|
blendLayers(background, foreground, BlendType.COLOURDODGE) |
|
``` |
|
|
|
![ColourDodge](test/data/colourdodge_expected.png) |
|
|
|
|
|
|
|
```python |
|
blendLayers(background, foreground, BlendType.REFLECT) |
|
``` |
|
|
|
![Reflect](test/data/reflect_expected.png) |
|
|
|
|
|
|
|
```python |
|
blendLayers(background, foreground, BlendType.GLOW) |
|
``` |
|
|
|
![Glow](test/data/glow_expected.png) |
|
|
|
|
|
|
|
```python |
|
blendLayers(background, foreground, BlendType.OVERLAY) |
|
``` |
|
|
|
![Overlay](test/data/overlay_expected.png) |
|
|
|
|
|
|
|
```python |
|
blendLayers(background, foreground, BlendType.DIFFERENCE) |
|
``` |
|
|
|
![Difference](test/data/difference_expected.png) |
|
|
|
|
|
|
|
```python |
|
blendLayers(background, foreground, BlendType.NEGATION) |
|
``` |
|
|
|
![Negation](test/data/negation_expected.png) |
|
|
|
|
|
|
|
```python |
|
blendLayers(background, foreground, BlendType.LIGHTEN) |
|
``` |
|
|
|
![Lighten](test/data/lighten_expected.png) |
|
|
|
|
|
|
|
```python |
|
blendLayers(background, foreground, BlendType.DARKEN) |
|
``` |
|
|
|
![Darken](test/data/darken_expected.png) |
|
|
|
|
|
|
|
```python |
|
blendLayers(background, foreground, BlendType.SCREEN) |
|
``` |
|
|
|
![Screen](test/data/screen_expected.png) |
|
|
|
|
|
|
|
```python |
|
blendLayers(background, foreground, BlendType.XOR) |
|
``` |
|
|
|
![XOR](test/data/xor_expected.png) |
|
|
|
|
|
|
|
```python |
|
blendLayers(background, foreground, BlendType.SOFTLIGHT) |
|
``` |
|
|
|
![SoftLight](test/data/softlight_expected.png) |
|
|
|
|
|
|
|
```python |
|
blendLayers(background, foreground, BlendType.HARDLIGHT) |
|
``` |
|
|
|
![HardLight](test/data/hardlight_expected.png) |
|
|
|
|
|
|
|
```python |
|
blendLayers(background, foreground, BlendType.GRAINEXTRACT) |
|
``` |
|
|
|
![GrainExtract](test/data/grainextract_expected.png) |
|
|
|
|
|
|
|
```python |
|
blendLayers(background, foreground, BlendType.GRAINMERGE) |
|
``` |
|
|
|
![GrainMerge](test/data/grainmerge_expected.png) |
|
|
|
|
|
|
|
```python |
|
blendLayers(background, foreground, BlendType.DIVIDE) |
|
``` |
|
|
|
![Divide](test/data/divide_expected.png) |
|
|
|
|
|
|
|
```python |
|
blendLayers(background, foreground, BlendType.HUE) |
|
``` |
|
|
|
![Hue](test/data/hue_expected.png) |
|
|
|
|
|
|
|
```python |
|
blendLayers(background, foreground, BlendType.SATURATION) |
|
``` |
|
|
|
![Saturation](test/data/saturation_expected.png) |
|
|
|
|
|
|
|
```python |
|
blendLayers(background, foreground, BlendType.COLOUR) |
|
``` |
|
|
|
![Colour](test/data/colour_expected.png) |
|
|
|
|
|
|
|
```python |
|
blendLayers(background, foreground, BlendType.LUMINOSITY) |
|
``` |
|
|
|
![Luminosity](test/data/luminosity_expected.png) |
|
|
|
|
|
|
|
```python |
|
blendLayers(background, foreground, BlendType.PINLIGHT) |
|
``` |
|
|
|
![PinLight](test/data/pinlight_expected.png) |
|
|
|
|
|
|
|
```python |
|
blendLayers(background, foreground, BlendType.VIVIDLIGHT) |
|
``` |
|
|
|
![VividLight](test/data/vividlight_expected.png) |
|
|
|
|
|
|
|
```python |
|
blendLayers(background, foreground, BlendType.EXCLUSION) |
|
``` |
|
|
|
![Exclusion](test/data/exclusion_expected.png) |
|
|
|
|
|
|
|
```python |
|
blendLayers(background, foreground, BlendType.DESTIN) |
|
``` |
|
|
|
![Exclusion](test/data/destin_expected.png) |
|
|
|
|
|
|
|
```python |
|
blendLayers(background, foreground, BlendType.DESTOUT) |
|
``` |
|
|
|
![Exclusion](test/data/destout_expected.png) |
|
|
|
|
|
|
|
```python |
|
blendLayers(background, foreground, BlendType.DESTATOP) |
|
``` |
|
|
|
![Exclusion](test/data/destatop_expected.png) |
|
|
|
|
|
|
|
```python |
|
blendLayers(background, foreground, BlendType.SRCATOP) |
|
``` |
|
|
|
![Exclusion](test/data/srcatop_expected.png) |
|
|
|
|
|
|
|
See the [Docs](/DOCS/) for more information. |
|
|
|
|
|
|
|
```python |
|
pip install blendmodes |
|
``` |
|
|
|
Head to https://pypi.org/project/blendmodes/ for more info |
|
|
|
|
|
|
|
|
|
|
|
This program has been written for Python versions 3.7 - 3.10 and has been tested with both 3.7 and |
|
3.10 |
|
|
|
|
|
|
|
|
|
|
|
```powershell |
|
choco install python |
|
``` |
|
|
|
|
|
|
|
To install Python, go to https://www.python.org/downloads/windows/ and download the latest |
|
version. |
|
|
|
|
|
|
|
|
|
|
|
```bash |
|
sudo apt install python3.x |
|
``` |
|
|
|
|
|
|
|
```bash |
|
sudo dnf install python3.x |
|
``` |
|
|
|
|
|
|
|
|
|
|
|
```bash |
|
brew install python@3.x |
|
``` |
|
|
|
|
|
|
|
To install Python, go to https://www.python.org/downloads/macos/ and download the latest |
|
version. |
|
|
|
|
|
|
|
|
|
|
|
- Module |
|
`py -3.x -m [module]` or `[module]` (if module installs a script) |
|
|
|
- File |
|
`py -3.x [file]` or `./[file]` |
|
|
|
|
|
|
|
- Module |
|
`python3.x -m [module]` or `[module]` (if module installs a script) |
|
|
|
- File |
|
`python3.x [file]` or `./[file]` |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1. Press the Clone or download button in the top right |
|
2. Copy the URL (link) |
|
3. Open the command line and change directory to where you wish to |
|
clone to |
|
4. Type 'git clone' followed by URL in step 2 |
|
|
|
```bash |
|
git clone https://github.com/FHPythonUtils/BlendModes |
|
``` |
|
|
|
More information can be found at |
|
https://help.github.com/en/articles/cloning-a-repository |
|
|
|
|
|
|
|
1. Press the Clone or download button in the top right |
|
2. Click open in desktop |
|
3. 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 |
|
|
|
|
|
|
|
1. Download this GitHub repository |
|
2. Extract the zip archive |
|
3. Copy/ move to the desired location |
|
|
|
|
|
|
|
|
|
|
|
MIT License |
|
(See the [LICENSE](/LICENSE.md) for more information.) |
|
|
|
|
|
|
|
See the [Changelog](/CHANGELOG.md) for more information. |
|
|
|
|
|
|
|
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](https://github.com/FHPythonUtils/.github/blob/master/CODE_OF_CONDUCT.md) |
|
for more information. |
|
|
|
|
|
|
|
Contributions are welcome, please see the |
|
[Contributing Guidelines](https://github.com/FHPythonUtils/.github/blob/master/CONTRIBUTING.md) |
|
for more information. |
|
|
|
|
|
|
|
Thank you for improving the security of the project, please see the |
|
[Security Policy](https://github.com/FHPythonUtils/.github/blob/master/SECURITY.md) |
|
for more information. |
|
|
|
|
|
|
|
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](https://github.com/FHPythonUtils/.github/blob/master/SUPPORT.md) |
|
for more information. |
|
|
|
|
|
|
|
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](https://github.com/FHPythonUtils/.github/blob/master/RATIONALE.md) |
|
for more information. |
|
|
|
|