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/noteshrinker /imgs/us_tax_form_1937.jpg -w
```
**Command line**
```bash
note-shrinker IMAGE1 [IMAGE2 ...]
```
**Integrating into your Python scripts**
```python
from NoteShrinker import NoteShrinker
# 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/noteshrinker /imgs/us_tax_form_1937.jpg -w
```
**Command line**
```bash
note-shrinker IMAGE1 [IMAGE2 ...]
```
**Integrating into your Python scripts**
```python
from NoteShrinker import NoteShrinker
# 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.2.0.tar.gz
(6.6 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.2.0.tar.gz.
File metadata
- Download URL: NoteShrinker-0.2.0.tar.gz
- Upload date:
- Size: 6.6 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 |
a5fa892209130d3e6fff2afbc91f84fb656f4e84818f4f6f80022f52d6151132
|
|
| MD5 |
10ef322684844b788dfd56fcd8b7667a
|
|
| BLAKE2b-256 |
3aaca38de14c8f4dac78b0a1a345250123d5aff0aa05de3970b2d54023e830b8
|
File details
Details for the file NoteShrinker-0.2.0-py3-none-any.whl.
File metadata
- Download URL: NoteShrinker-0.2.0-py3-none-any.whl
- Upload date:
- Size: 9.6 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 |
93f224de84018e52fba5b27676648f08b94efb29f8c4c564423945a9cd440290
|
|
| MD5 |
8c0cbb48c527da2ef442e84c0ea51b54
|
|
| BLAKE2b-256 |
ff67169e2b50c6184ec27f6e9b41af075cf4c909521f63678fb9ee44f6e11d91
|