basic PIL functions