An efficient segmentation algorithm for region-based coding is proposed. A new connected operator based on both size and contrast is presented and an efficient region merging algorithm which preserves high quality in terms of the number of regions is proposed. Experimental results show that the proposed algorithm achieves a good performance in terms of the image quality and the number of regions.