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.
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
-----
**Commandline**
```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.
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
-----
**Commandline**
```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.0.tar.gz
(5.8 kB
view hashes)
Built Distribution
Close
Hashes for NoteShrinker-0.1.0-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | e183a214918bb715e3d002ab54216d3d8a21327a38afcfa1da242426d11406aa |
|
MD5 | a13381938dad2e3d2f758dd4f4d49843 |
|
BLAKE2b-256 | 212b7863884cd2ffb55bedaa6ca7c9d824e0fcae2c506b4bcebaf8669e93b5b7 |