CoreImage helpers in Swift