greatly improve performances by creating image data directly