Compression ratios of encoding algorithms degrade due to signal distortion, additive noise, and hacker manipulation. Large file size costs too much disk space, difficult to analyze, and high bandwidth to transmit over the internet. In this case, compression is mandatory. LZW is a general dictionary-based lossless compression algorithm. It is fast, simple, and efficient when it includes lots of repetitive data or monochrome images. Images with little data repetition and too much-blurred signal, the compression ratio of the LZW algorithm downgraded. Besides this, the execution time of the LZW compression algorithm increases dramatically. To preprocess and analyze the image information the researcher uses LZW encoding algorithm, bit plane slicing technique, Adaptive Median Filter, and MATLAB image processing toolbox. The MATLAB public grayscale image, salt & pepper, Gaussian locavore blurred, and Bayern pattern image data sets are used. Those images dataset is used to test the normal LZW encoding algorithm and the proposed encoding algorithm compression ratio step by step. The noised dataset, the filtered datasets, and bit plane dataset images are processed and recorded quality and compression ratio parameters. The enhanced encoding algorithm average compression ratio is better by far from the normal LZW encoding algorithm by 160%. Not only has the compression ratio, but demising also improved the algorithms execution time. And the image quality metrics measurement of mean square error, peak signal to noise ratio, and structural similarity index measurement are 0, 99, and 1 respectively. This implies the enhanced encoding algorithm could decompress fully without scarifying image quality. The LZW encoding algorithm developmental environment specifies to select tiff and gif image formats. In addition, the LZW encoding algorithm functions are not available in the MATLAB image processing toolbox. The researcher challenged to write a MATLAB script for each personal function. Still, there is room to extend the compression ratio of the LZW encoding algorithm using the image masking technique.