https://github.com/ghandic/noteshrinker
Convert scans of handwritten notes to beautiful, compact Images
https://github.com/ghandic/noteshrinker
compression forms image image-processing noteshrink ocr
Last synced: over 1 year ago
JSON representation
Convert scans of handwritten notes to beautiful, compact Images
- Host: GitHub
- URL: https://github.com/ghandic/noteshrinker
- Owner: ghandic
- License: mit
- Created: 2018-07-27T23:49:37.000Z (almost 8 years ago)
- Default Branch: master
- Last Pushed: 2022-06-21T21:23:09.000Z (almost 4 years ago)
- Last Synced: 2025-03-15T01:37:31.743Z (over 1 year ago)
- Topics: compression, forms, image, image-processing, noteshrink, ocr
- Language: Python
- Size: 2.08 MB
- Stars: 15
- Watchers: 1
- Forks: 2
- Open Issues: 4
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
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')
```