Skip to content

Instantly share code, notes, and snippets.

@zaa
Forked from lelandbatey/whiteboardCleaner.md
Created April 3, 2014 06:40

Revisions

  1. @lelandbatey lelandbatey revised this gist Apr 3, 2014. 1 changed file with 1 addition and 1 deletion.
    2 changes: 1 addition & 1 deletion whiteboardCleaner.md
    Original file line number Diff line number Diff line change
    @@ -5,7 +5,7 @@ This simple script will take a picture of a whiteboard and use parts of the Imag
    The script is here:

    #!/bin/bash
    convert $1 -resize %50 -morphology Convolve DoG:15,100,0 -negate -normalize -blur 0x1 -channel RBG -level 60%,91%,0.1 $2
    convert $1 -morphology Convolve DoG:15,100,0 -negate -normalize -blur 0x1 -channel RBG -level 60%,91%,0.1 $2

    # Results

  2. @lelandbatey lelandbatey revised this gist Jan 28, 2014. 1 changed file with 4 additions and 4 deletions.
    8 changes: 4 additions & 4 deletions whiteboardCleaner.md
    Original file line number Diff line number Diff line change
    @@ -11,15 +11,15 @@ The script is here:

    Here are some of the input images:

    ![](http://i.imgur.com/CTSIPwm.jpg)
    ![](http://i.imgur.com/CTSIPwmm.jpg)

    ![](http://i.imgur.com/37GXrwo.jpg)
    ![](http://i.imgur.com/37GXrwom.jpg)

    And here are the results:

    ![](http://i.imgur.com/Qf3jkBW.png)
    ![](http://i.imgur.com/Qf3jkBWm.png)

    ![](http://i.imgur.com/oNueb0L.png)
    ![](http://i.imgur.com/oNueb0Lm.png)

    # Usage

  3. @lelandbatey lelandbatey revised this gist Jan 28, 2014. 1 changed file with 4 additions and 4 deletions.
    8 changes: 4 additions & 4 deletions whiteboardCleaner.md
    Original file line number Diff line number Diff line change
    @@ -11,15 +11,15 @@ The script is here:

    Here are some of the input images:

    [[ http://i.imgur.com/CTSIPwm.jpg | height = 300px]]
    ![](http://i.imgur.com/CTSIPwm.jpg)

    [[http://i.imgur.com/37GXrwo.jpg | height = 300px]]
    ![](http://i.imgur.com/37GXrwo.jpg)

    And here are the results:

    [[http://i.imgur.com/Qf3jkBW.png | height = 300px]]
    ![](http://i.imgur.com/Qf3jkBW.png)

    [[http://i.imgur.com/oNueb0L.png | height = 300px]]
    ![](http://i.imgur.com/oNueb0L.png)

    # Usage

  4. @lelandbatey lelandbatey revised this gist Jan 28, 2014. 1 changed file with 6 additions and 4 deletions.
    10 changes: 6 additions & 4 deletions whiteboardCleaner.md
    Original file line number Diff line number Diff line change
    @@ -11,13 +11,15 @@ The script is here:

    Here are some of the input images:

    - [Example input 1](http://i.imgur.com/CTSIPwm.jpg)
    - [Example input 2](http://i.imgur.com/37GXrwo.jpg)
    [[ http://i.imgur.com/CTSIPwm.jpg | height = 300px]]

    [[http://i.imgur.com/37GXrwo.jpg | height = 300px]]

    And here are the results:

    - [Output example 1](http://i.imgur.com/Qf3jkBW.png)
    - [Output example 2](http://i.imgur.com/oNueb0L.png)
    [[http://i.imgur.com/Qf3jkBW.png | height = 300px]]

    [[http://i.imgur.com/oNueb0L.png | height = 300px]]

    # Usage

  5. @lelandbatey lelandbatey created this gist Jan 28, 2014.
    34 changes: 34 additions & 0 deletions whiteboardCleaner.md
    Original file line number Diff line number Diff line change
    @@ -0,0 +1,34 @@
    # Description

    This simple script will take a picture of a whiteboard and use parts of the ImageMagick library with sane defaults to clean it up tremendously.

    The script is here:

    #!/bin/bash
    convert $1 -resize %50 -morphology Convolve DoG:15,100,0 -negate -normalize -blur 0x1 -channel RBG -level 60%,91%,0.1 $2

    # Results

    Here are some of the input images:

    - [Example input 1](http://i.imgur.com/CTSIPwm.jpg)
    - [Example input 2](http://i.imgur.com/37GXrwo.jpg)

    And here are the results:

    - [Output example 1](http://i.imgur.com/Qf3jkBW.png)
    - [Output example 2](http://i.imgur.com/oNueb0L.png)

    # Usage

    Assuming it's saved as a file named `whiteboardClean.sh`, the command is `./whiteboardClean.sh {name of input file} {name of file to output to}`.

    Here's an example:

    ./whiteboardClean.sh example1.jpg output1.png

    # How I Came Up With This

    I was doing a lot work with whiteboards and I'd been taking pictures of them to document what had been written. I wanted a more clean version of the pictures though, something that captured the essence of what a whiteboard image showed.

    Eventually I found [this excellent guide to cleaning up whiteboard photos using GIMP.](http://matthew.mceachen.us/blog/how-to-clean-up-photos-of-whiteboards-with-gimp-403.html) However, I found I wanted more automation. So, I spent a few hours yesterday figuring out how to do the same thing using ImageMagick from the command line and made this script.