The automated segmentation of liver is an essential phase in liver diagnosis in medical images. In this paper, the artificial bee colony optimization algorithm (ABC) is used as a clustering technique to segment the whole liver. ABC calculates the centroids of clusters in CT liver image and extracts a binary image for each cluster. Using some morphological operations can help to remove small and thin regions, which represents parts of flesh around liver, sharp edges of organs and small lesions inside the liver. Then the large regions in each cluster binary image are filled.