Metadata-Version: 2.1
Name: rgb2gray
Version: 0.0.3
Summary: rgb2gray
Home-page: https://github.com/camille1/rgb2gray/
Author: camille1
Author-email: camillelacan1@gmail.com
License: Apache Software License 2.0
Keywords: nbdev
Classifier: Development Status :: 3 - Alpha
Classifier: Intended Audience :: Developers
Classifier: Natural Language :: English
Classifier: Programming Language :: Python :: 3.9
Classifier: Programming Language :: Python :: 3.10
Classifier: License :: OSI Approved :: Apache Software License
Requires-Python: >=3.9
Description-Content-Type: text/markdown
Provides-Extra: dev
License-File: LICENSE

RGB2Gray
================

<!-- WARNING: THIS FILE WAS AUTOGENERATED! DO NOT EDIT! -->

RGB to grayscale image converter.

## Install

Install using:

    pip install rgb2gray

or:

    conda install -c rgb2gray

## How to use

This lib provides a `get_gs` function to convert an RGB image to a
grayscale

``` python
from rgb2gray.converter import get_gs

from PIL import Image
import matplotlib.pyplot as plt
from io import BytesIO
import requests
```

``` python
red = Image.new('RGB', (10, 10), color = (255,0,0))
fig, axes = plt.subplots(nrows=1, ncols=2, figsize=(7,7))
axes[0].imshow(red)
axes[1].imshow(get_gs(red), cmap='gray')
plt.show();
```

![](index_files/figure-gfm/cell-3-output-1.png)

``` python
url= 'https://cdn.analyticsvidhya.com/wp-content/uploads/2019/07/3.jpg'
img = Image.open(BytesIO(requests.get(url).content))

fig, axes = plt.subplots(nrows=1, ncols=2, figsize=(15,10))

axes[0].imshow(img)
axes[1].imshow(get_gs(img), cmap='gray')
plt.show();
```

![](index_files/figure-gfm/cell-4-output-1.png)
