There is a great tutorial to optimise the color map for RGBD files, and from depth and colour images:
Is it possible to do this when you already have a PCD?
The key command in that tutorial is:
o3d.pipelines.color_map.color_map_optimization(mesh, rgbd_images, camera, option)
Is it possible to supply a PCD file?