https://github.com/bglezseoane/monoshape
Extracts a monochromatic shape in the desired color from an image. Works as final TUI app and as Python library
https://github.com/bglezseoane/monoshape
image image-processing shapes
Last synced: 3 months ago
JSON representation
Extracts a monochromatic shape in the desired color from an image. Works as final TUI app and as Python library
- Host: GitHub
- URL: https://github.com/bglezseoane/monoshape
- Owner: bglezseoane
- License: mit
- Created: 2019-06-30T08:52:11.000Z (almost 6 years ago)
- Default Branch: master
- Last Pushed: 2023-10-03T21:34:39.000Z (over 1 year ago)
- Last Synced: 2025-03-04T04:15:49.326Z (4 months ago)
- Topics: image, image-processing, shapes
- Language: Python
- Homepage:
- Size: 536 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 1
-
Metadata Files:
- Readme: README.md
- Changelog: CHANGELOG.md
- License: LICENSE
Awesome Lists containing this project
README
# monoshape
This program takes an image that has well differentiated light and dark tones and extracts its monochromatic shape in the desired colour with a transparent background.

This sofware can be used as final TUI app or as Python library.
## To set up
You can use Homebrew to install this program via my tap repository:
```sh
brew install glezseoane/homebrew-tap/monoshape
```You also can use PyPI to install this program:
```sh
pip install monoshape
```Alternative, clone and go to this repository home directory, and then run:
```sh
python setup.py install
```Both methods install last **monoshape** stable version on your machine.
## Use as final app
Simple use:
```sh
monoshape image.png desired_shape.png
```Draw a red shape:
```sh
monoshape image.png desired_shape.png -rgb 255 0 0
```Explore the man page to know all possible functionalities.
## Use as library
Simply import main module and use export function:
```python
import monoshape.__main__ as monoshapedrawn = monoshape.extract_shape(path=source,
black_background=False,
white_shape=False,
rgb_shape=False,
red=None,
green=None,
blue=None)
```
Read the man of this tool to known more about its use.
> Note about man pages: if you use `pip` method to install this program, assert that man directories of your python environment are added to your `MANPATH` to can get this program's man pages with the `man` command. Python might install man pages in default machine level directories.