Mathematical morphology is a general theory that studies the decomposition of operators between complete lattices in terms of some families of simple operators: dilations, erosions, antidilations, and antierosions. Nowadays, this theory is largely used in image processing and computer vision to extract information from images. The KHOROS system is an open and general environment
for image processing and visualization that has become very popular. One of the main characteristics of KHOROS is its flexibility, since it runs on standard machines, supports several standard data formats, uses a visual programming language, and has tools to help the users to build in and install their own programs. A set of new programs can be organized as a subsystem called a toolbox. We present MMach, a fast and comprehensive mathematical morphology toolbox for the KHOROS system dealing with 1-D and 2-D grayscale and binary images. Each program that is applicable to grayscale and binary images has specialized algorithms for each of these data types, and these algorithms are chosen automatically according to the input data. Several examples illustrate applications of the toolbox in image analysis.