Display controller processes a great amount of data within a bounded time and thus requires high memory bandwidth. The memory bandwidth will dominate system performance, especially in embedded systems. In this paper, we propose a hybrid algorithm called APE (Adaptive Pixel Encoding) for lossless frame buffer compression considering high compression performance and real time operation. The algorithm combines dictionary coding and run length coding to achieve a low compression ratio. We integrate APE frame buffer compression architecture into a display controller. Experimental results show that the proposed algorithm gains 19.7% of compression ratio and 66.2% of memory bandwidth reduction ratio during sweep operation. It is much more effective than all previous works.