Giter Site home page Giter Site logo

noteshrinker's Introduction

NoteShrinker

GitHub stars Docker build Travis build Package version License

This Repo packages up the work from Mark Zucker into a python module and cli script

Convert scans of handwritten notes to beautiful, compact PDFs see full writeup

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.4MBOriginal example 1 Size: 516KBNoteShunk example 1
Size: 73KBOriginal example 2 Size: 51KBNoteShunk example 2
Size: 132KBOriginal example 3 Size: 109KBNoteShunk example 3

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:

pip install numpy scipy pillow
pip install NoteShrinker

Usage

Docker

docker run -v $PWD/Examples/Input:/imgs challisa/noteshrinker /imgs/us_tax_form_1937.jpg -w

Command line

    note-shrinker IMAGE1 [IMAGE2 ...]

Integrating into your Python scripts

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')

noteshrinker's People

Contributors

ghandic avatar stickler-ci avatar

Watchers

James Cloos avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.