Metadata-Version: 2.1
Name: photoidmagick
Version: 1.1.9
Summary: Python library to automatically align and crop your photos to the correct biometric passport photo size
Home-page: https://github.com/majormode/photoidmagick-python-library
License: SEE LICENSE IN <LICENSE.md>
Keywords: photo,library,biometric,passport,cli
Author: Daniel CAUNE
Author-email: daniel.caune@gmail.com
Requires-Python: >=3.9,<4.0
Classifier: Development Status :: 5 - Production/Stable
Classifier: License :: OSI Approved :: MIT License
Classifier: License :: Other/Proprietary License
Classifier: Operating System :: OS Independent
Classifier: Programming Language :: Python
Classifier: Programming Language :: Python :: 3
Classifier: Programming Language :: Python :: 3.9
Classifier: Programming Language :: Python :: 3.10
Classifier: Programming Language :: Python :: 3.11
Classifier: Topic :: Software Development :: Libraries
Requires-Dist: dlib
Requires-Dist: exifread
Requires-Dist: face-recognition
Requires-Dist: numpy
Requires-Dist: perseus-core-library
Requires-Dist: pillow
Project-URL: Repository, https://github.com/majormode/photoidmagick-python-library
Description-Content-Type: text/markdown

# Photo ID Magick

Python library to automatically align and crop your photos to the correct biometric passport photo size.

This library is based on the libraries [face_detection](https://github.com/ageitgey/face_recognition) and [Pillow](https://python-pillow.org/).

## Installation

```bash
$ pip install photoidmagick
```

## Usage

|                         |                         |                         |                         |
| ----------------------- | ----------------------- | ----------------------- | ----------------------- |
| ![](doc/sample_003.jpg) | ![](doc/sample_005.jpg) | ![](doc/sample_009.jpg) | ![](doc/sample_011.jpg) |

|                                |                                |                                |                                |
| ------------------------------ | ------------------------------ | ------------------------------ | ------------------------------ |
| ![](doc/sample_003.square.jpg) | ![](doc/sample_005.square.jpg) | ![](doc/sample_009.square.jpg) | ![](doc/sample_011.square.jpg) |

```bash
$ photoidmagick -f sample_039.jpg -s 1750x2250
Traceback (most recent call last):
__main__.ObliqueFacePoseException: the midsagittal facial line doesn't intersect the midhorizontal iris line in the middle


$ photoidmagick -f sample_039.jpg -s 350x450 --allow-oblique-face
```

| Original                | Passport Photo Format            | Square Photo Format            |
| ----------------------- | -------------------------------- | ------------------------------ |
| ![](doc/sample_039.jpg) | ![](doc/sample_039.passport.jpg) | ![](doc/sample_039.square.jpg) |

```bash
$ photoidmagick -f sample_054.jpg -s 400x400 --allow-oblique-face
Traceback (most recent call last):
__main__.UnevenlyOpenEyelidException: the right eye is more opened than the left eye

$ photoidmagick -f sample_054.jpg -s 1000x1000 --allow-oblique-face --allow-unevenly-open-eye
```

| Original                | Passport Photo Format            | Square Photo Format            |
| ----------------------- | -------------------------------- | ------------------------------ |
| ![](doc/sample_054.jpg) | ![](doc/sample_054.passport.jpg) | ![](doc/sample_054.square.jpg) |  |

