Otsify (pron. [ˈoː.tsɪ.faɪ]) is a simple CLI tool for otsifying images, just kidding i.e. converting any image into black&white.
The name is a portmanteau of the surname Ōtsu (see Description) and the suffix -ify (as in simple (adj) > simplify (v)). Grammatically, it is a verb, so it can be used as in "Wait a second! I haven't otsified this image yet.".
The program uses Otsu's method
so as to threshold an image automatically.
Afterwards, if the -i
flag is used, it will filter the "isolated" pixels,
thus visually explained:
# = black
· = white
# # # # # #
# · # ==> # # #
# # # # # #
· · · · · ·
· # · ==> · · ·
· · · · · ·
This helps shrink the output image file size, because of how the .png
format
works. Otsu's method leaves many of such pixels on images that either have a lot
of noise or don't have a strongly bimodal gray histogram. So it is particularly
helpful on those kinds of images.
Brainstorm of new features:
--colored
or--rgb
or-c
: this flag would otsify each RGB channel individually.
Download the binary which suits your operating system & run it from the command line. Otherwise, þou canst build it from source.
Pass as CLI arguments the names of the input and optional output image files.
If no output name is passed, the default is generated from the input, e.g.
from example.jpg
will result to example_otsu.png
. Output files must be png.
- Windows:
otsify.exe [options] example.jpg output.png
- Linux:
./otsify [options] example.jpg output.png
-h, --help
: Print help information-q, --quiet
: Print fatal errors only-i
: Remove isolated pixels
This software is licensed under the GPLv3.