Metadata-Version: 2.1
Name: image2base64
Version: 0.0.5
Summary: Image to base64 and back.
Home-page: https://github.com/ternaus/base64ToImageConverters
Author: Vladimir Iglovikov
License: MIT
Classifier: Intended Audience :: Developers
Classifier: Intended Audience :: Science/Research
Classifier: Operating System :: OS Independent
Classifier: Programming Language :: Python
Classifier: Programming Language :: Python :: 3
Classifier: Topic :: Software Development :: Libraries
Classifier: Topic :: Software Development :: Libraries :: Python Modules
Description-Content-Type: text/markdown
Provides-Extra: test
License-File: LICENSE

# Library for converting RGB / Grayscale numpy images from to base64 and back.

## Installation
```bash
pip install -U image_to_base_64
```

## Conversion
Takes `numpy.array` or `PIL.Image` as input

### RGB to base 64
```python
base64 = rgb2base64(rgb_image, image_format)
```
where image format is `JPEG`, `PNG`

### Grayscale to base 64

```python
base64 = grayscale2base64(grayscale_image)
```

### Base64 to RGB image

```python
output_type = "cv2" # or "PIL"
rgb_image = base64_to_rgb(base64, output_type)
```

### Base64 to Grayscale image
```python
output_type = "cv2" # or "PIL"
grayscale_image = base64_to_grayscale(base64, output_type)
```


#### Issues
For some reason I cannot convert `RGB` image to `JPEG` representation in base 64 and back without losses.
=> test only for `PNG` and not `JPEG`
