Implementing image partition.