Smart shrinking of the size and color palette of images
Project description
NoteShrinker
==========
This Repo packages up the work from [Mark Zucker](https://github.com/mzucker/noteshrink) into a python module and cli script
Convert scans of handwritten notes to beautiful, compact *PDFs* [see full writeup](https://mzucker.github.io/2016/09/20/noteshrink.html)
Note this package does not convert to PDF as the original module relies on ImageMagick, this is very easy to implement yourself.
Examples
------------
These examples use the default settings in the Python module.
Original | NoteShrunk
:-------------------------:|:-------------------------:
**Size: 1.4MB** | **Size: 516KB**
**Size: 73KB** | **Size: 51KB**
**Size: 132KB**| **Size: 109KB**
Requirements
------------
- Python 2 or 3
- NumPy 1.10 or later
- SciPy
- Image module from PIL or Pillow
Installation
-----
**Ensure you have Numpy, SciPy and PIL installed:**
```python
pip install numpy scipy pillow
```
```python
pip install NoteShrinker
```
Usage
-----
**Docker**
```bash
docker run -v $PWD/Examples/Input:/imgs challisa/note-shrinker /imgs/us_tax_form_1937.jpg -w
```
**Command line**
```bash
note-shrinker IMAGE1 [IMAGE2 ...]
```
**Integrating into your Python scripts**
```python
from NoteShrinker import NoteShinker
# Create a NoteShrink object full of images, either an array of filepaths, PIL images or numpy arrays
ns = NoteShrinker(['test.png'], **args)
# Shrink the images by calling the shrink method, this returns an array of PIL images encoded as RGB
shrunk = ns.shrink()
# Carry on with your image processing...
for img in shrunk:
img.save('example.png')
```
==========
This Repo packages up the work from [Mark Zucker](https://github.com/mzucker/noteshrink) into a python module and cli script
Convert scans of handwritten notes to beautiful, compact *PDFs* [see full writeup](https://mzucker.github.io/2016/09/20/noteshrink.html)
Note this package does not convert to PDF as the original module relies on ImageMagick, this is very easy to implement yourself.
Examples
------------
These examples use the default settings in the Python module.
Original | NoteShrunk
:-------------------------:|:-------------------------:
**Size: 1.4MB** | **Size: 516KB**
**Size: 73KB** | **Size: 51KB**
**Size: 132KB**| **Size: 109KB**
Requirements
------------
- Python 2 or 3
- NumPy 1.10 or later
- SciPy
- Image module from PIL or Pillow
Installation
-----
**Ensure you have Numpy, SciPy and PIL installed:**
```python
pip install numpy scipy pillow
```
```python
pip install NoteShrinker
```
Usage
-----
**Docker**
```bash
docker run -v $PWD/Examples/Input:/imgs challisa/note-shrinker /imgs/us_tax_form_1937.jpg -w
```
**Command line**
```bash
note-shrinker IMAGE1 [IMAGE2 ...]
```
**Integrating into your Python scripts**
```python
from NoteShrinker import NoteShinker
# Create a NoteShrink object full of images, either an array of filepaths, PIL images or numpy arrays
ns = NoteShrinker(['test.png'], **args)
# Shrink the images by calling the shrink method, this returns an array of PIL images encoded as RGB
shrunk = ns.shrink()
# Carry on with your image processing...
for img in shrunk:
img.save('example.png')
```
Project details
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
NoteShrinker-0.1.1.tar.gz
(6.2 kB
view details)
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file NoteShrinker-0.1.1.tar.gz.
File metadata
- Download URL: NoteShrinker-0.1.1.tar.gz
- Upload date:
- Size: 6.2 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/1.11.0 pkginfo/1.4.2 requests/2.19.1 setuptools/20.7.0 requests-toolbelt/0.8.0 tqdm/4.24.0 CPython/3.6.5
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
1dee78222d5b4987dce38a6781ba47a5cecb479c8f75f604e56cc6425e968ff3
|
|
| MD5 |
e73b4b6896ff0b307332717ef2694ae0
|
|
| BLAKE2b-256 |
b430e1bd2a731eb3c2533ab299b333af2b30ce73aa7f322833776b3e7d3dd1f0
|
File details
Details for the file NoteShrinker-0.1.1-py3-none-any.whl.
File metadata
- Download URL: NoteShrinker-0.1.1-py3-none-any.whl
- Upload date:
- Size: 9.1 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/1.11.0 pkginfo/1.4.2 requests/2.19.1 setuptools/20.7.0 requests-toolbelt/0.8.0 tqdm/4.24.0 CPython/3.6.5
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
699e13b37121eb7ea879d85244b3f29ffd9cad514f428c07effa8d070760dbce
|
|
| MD5 |
965437a3571b8f61eaf8bfd289ea789c
|
|
| BLAKE2b-256 |
e75febf167bbbf1062e82c428d0fa48a66bed4f5ff7c99c86496e3d3369175ab
|