We propose an efficient lossless compression scheme for still images based on arithmetic coding. The scheme presents a novel adaptive arithmetic coding that updates the probabilities of pixels only after detecting the last occurrence of each pixel and then removes the redundancy from the original image effectively. The proposed approach has interestingly low computational complexity. In addition, unlike other statistical coding techniques, arithmetic coding in the proposed scheme is not solely dependent on the pixel probability distribution but also on the image block sorting. The proposed method is compared to both static and adaptive order-0 models while taking into account compression ratios and processing time. Experimental results, based on a set of 100 gray-level images, demonstrate that the proposed scheme gives mean compression ratios that are 5.5% higher than those by the conventional arithmetic encoders as well as significantly faster than the order-0 adaptive arithmetic coding.