Morphological image processing is an important tool for a broad range of problems in image processing. A 512-entry table lookup method is used for real-time implementation. But it is not efficient to transfer this method directly into software. The author proposes a fast software implementation technique, in which a 256-entry lookup table containing neighborhood information is built and a dynamic table lookup process is applied to reduce the number of logical matching operations and the number of accesses of the neighboring pixels. In this proposed method only the foreground pixels, which are pixels on the object, are processed. Among the foreground pixels, only at the starting pixel of each "run" of l's is it necessary to read the eight neighboring pixels. For the other pixels, it is necessary to read only three neighbors. This method shows a significant improvement in timesaving. In addition, for systems supporting fast access to consecutive address memory, the author proposes another implementation, which treats the image as a contiguous block of memory. Thus advantage is taken of RAM technology.