example 4 now takes aperture, quality and resolution as parameter