Git Product home page Git Product logo

white-brush's Introduction

White Brush GitHub license Issue Stats Issue Stats

White Brush is a tool for enhancing hand-written notes.

Build Status

Branch Status Information
master Build Status Coverage Status

Usage

Installing
git clone [email protected]:lukasbindreiter/white-brush.git
cd white-brush
python setup.py install
Executing
white-brush test_images/01.png
Context Menu Entry

If you are on windows, you can also register the program as context menu entry, allowing you to right click on an image to enhance it.

python setup.py register_menu_entry

Example: Usage as context menu entry

Contributing / Development

  1. Checkout the repository
  2. Install the requirements
pipenv install --dev
  1. Run the tests
pytest
# to output a code coverage report
pytest --cov=white_brush --cov-report html

Docker Usage

Instead of installing the pipenv dependencies on your system, you can also use the Dockerfile which is provided in the root directory:

docker build -t white-brush .
docker run -it --rm white-brush python -m white_brush test_images/01.jpg 01_enhanced.jpg

Or to start a jupyter to which you can connect to take a look at the provided notebooks:

# First use docker build command above, then
docker run -d --rm -p 8888:8888 white_brush

Then go ahead and connect to http://localhost:8888 in your browser.

white-brush's People

Contributors

dependabot[bot] avatar lukasbindreiter avatar shynixn avatar

Stargazers

 avatar

Watchers

 avatar  avatar  avatar  avatar

Forkers

meik99 matt45m

white-brush's Issues

Allow Color conversions

It should be possible to e.g. convert an Image of a blackboard to a white background black foreground image

Add CLI Interface

TODOS:

  • Carefully think about what kind of requirements we need
  • Implement it in the main.py file

Some sample requirements are:

  • Converting multiple images
  • Converting folders with images
  • Converting images with background colors
  • Converting images for blackboard
  • ...

EDIT:
Bestes Pattern:
https://en.wikipedia.org/wiki/Command_pattern

Commands:

- whitebrush [options...] <files...>
Default command. Converts the given files and folders (with 1 deepness) and generates files appends _brushed before the extension.
- whitebrush --recursive (-r)
Converts the given files and folders (with endless deepness).
- whitebrush --convert (-c)
Replaces all files instead of adding the default _brushed name.
-whitebrush --mask (-m) <{name}mybrushedimage{extension}>
Changes the default added _brushed to the given text which isn't the placeholder {name} and extension.
-whitebrush --background(-b) < HTML ColorCode>
Converts the background to the given color code.
-whitebrush --forground(-f) < HTML ColorCode>
Converts the forground to the given color code.
-whitebrush --template (-t) <blackboard/whiteboard/note>
Converts the forground and background to the color code templates.
whitebrush --help (-h)
Displays the help page.

Requirements:

  • All options should be specifiable in one command
  • When using background or forground changes the last specified parameter should be used

Identify/Replace Background Color in Images

Create a method to extract the background in an Image and to calculate one clear background color.
Make sure this works for:

  • white background
  • blackboards
  • Post-Its in different colors
  • notebooks
  • Different light conditions
    • everything in light / shadows
    • mixed conditions

Create setup.py script

Create a setup.py script in order to allow system wide installation of the module

python setup.py build && python setup.py install should install the module

Also include an entry_point for white_brush, so that you can just run white_brush ... on the command line instead of python -m white_brush

the install requires dependencies should be read from the Pipfile if possible

Create method to convert colors from different formats to a RGB tuple

Via the CLI the user should be able to specify colors either by hex code or by name
What we need is a method parse_color, which works like this:

>>> parse_color("#ff0000")
(255, 0, 0)
>>> parse_color("Red") # should be case insensitive
(255, 0, 0)

The webcolor project already contains functionality to convert color names to rgb values and also to parse hex color codes, so the easiest approach would probably be to integrate that.

parse_color should probably be best placed in a new utils.py module in white_brush.colors

Create documentation

"Erstellen sie einen Projektabschlussbericht der auf ca. 8-10
Seiten mindestens folgendes enthält:
‣Team und Thema (Titelblatt ist nicht notwendig)
‣Projektbeschreibung
‣Überblick über ihre Entwicklung (Diagramme, Screenshots, etc)
‣Beschreibung der realisierten Funktionen gerne in technischen Details
‣Mind. drei Quellen / Links die ihre Kollegen als Startpunkte für ähnliche
Projekte verwenden können"

Registry entry for context menu

Create an entry for the context menu on (Image) Files in Windows Explorer. It should work similar to PeaZip, 7Zip, see the attached image:
pasted image 0

Make test_choose_representative_colors_different_values deterministic

Sometimes the test test_choose_representative_colors_different_values (in tests/test_calc_colors.py) passes, sometimes it fails.

If you add another test method running that test often:

def test_choose_representative_colors_different_values_often(self):
    for i in range(100):
        self.test_choose_representative_colors_different_values()

it will never pass

@p-hofer please take a look

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.