Optimization: Removed unnecessary CGImage/CGImageRef workflow.