Write depth and color

I can see how we read depth and color with Astra SDK, but I don’t manage to write these data as depth and color picture. Could someone help me on this?
Does anyone also know how to generate directly 3D point clouds in .ply or .pcl format?
Thanks and regards,