copied a image lib function