← Back to team overview

zim-wiki team mailing list archive

Custom tool: whiteboard cleaner

 

Hi,

just want to share this with you...

When I have a meeting I like to draw on the whiteboard and  take a photo from the board.
And of course I add this picture into Zim for documentation :)

I stumbled into this:

https://gist.github.com/lelandbatey/8677901

My Zim implementation:


·         I installed ImageMagick to c:\Tools\ImageMagick

·         Added C:\Tools\ImageMagick\ to PATH

·         Created this batch file wbclean.bat

mkdir "%1\tmp_dir"

cd %1
FOR %%A IN ("*.jpg" "*.gif" "*.png") DO (
    copy %%A tmp_dir
)

FOR %%A IN ("*.jpg" "*.gif" "*.png") DO (
    rename "%%A" "orig_%%A"
)

cd "%1\tmp_dir"
FOR %%A IN ("*.jpg" "*.gif" "*.png") DO (
    convert "%%A" -morphology Convolve DoG:15,100,0 -negate -normalize -channel RBG -level 60%%,91%%,0.1 -resize 50%% "%%A"
)
copy *.* %1\*.*
cd %1
del /q /s /f "%1\tmp_dir"
rmdir "%1\tmp_dir"


·         Created a custom tool entry

o   Name: Convert Images 50%

o   Command: C:\Tools\ImageMagick\wbclean.bat %d



When you start this custom tool on your note with a picture, it converts the picture and resizes it (original picture is backed up).

Have fun!

Murat