Metadata-Version: 2.1
Name: cjm-pil-utils
Version: 0.0.2
Summary: Some PIL utility functions I frequently use.
Home-page: https://github.com/cj-mills/cjm-pil-utils
Author: cj-mills
Author-email: millscj.mills2@gmail.com
License: Apache Software License 2.0
Keywords: nbdev jupyter notebook python
Classifier: Development Status :: 4 - Beta
Classifier: Intended Audience :: Developers
Classifier: Natural Language :: English
Classifier: Programming Language :: Python :: 3.7
Classifier: Programming Language :: Python :: 3.8
Classifier: Programming Language :: Python :: 3.9
Classifier: Programming Language :: Python :: 3.10
Classifier: License :: OSI Approved :: Apache Software License
Requires-Python: >=3.7
Description-Content-Type: text/markdown
License-File: LICENSE
Requires-Dist: fastcore
Requires-Dist: pandas
Requires-Dist: numpy
Requires-Dist: pillow
Provides-Extra: dev

cjm-pil-utils
================

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

## Install

``` sh
pip install cjm_pil_utils
```

## How to use

### get_img_files

``` python
from cjm_pil_utils.core import get_img_files
from pathlib import Path
```

``` python
img_dir = Path('../images/')
img_paths = get_img_files(img_dir)
img_paths
```

    [PosixPath('../images/cat.jpg'), PosixPath('../images/depth-cat.png')]

### resize_img

``` python
from cjm_pil_utils.core import resize_img
from PIL import Image  # For working with images
```

``` python
img_path = img_paths[0]
src_img = Image.open(img_path).convert('RGB')
print(f"Image Size: {src_img.size}")

resized_img = resize_img(src_img, target_sz=384, divisor=32)
print(f"New Image Size: {resized_img.size}")
```

    Image Size: (768, 512)
    New Image Size: (576, 384)

### stack_imgs

``` python
from cjm_pil_utils.core import stack_imgs
```

``` python
stacked_imgs = stack_imgs([resized_img, resized_img])
print(f"Stacked Image Size: {stacked_imgs.size}")
```

    Stacked Image Size: (576, 768)
