Generating spherical terrain using heightmaps

Hey forums,

I’ve been looking into making spherical planets with smooth terrain, however I want them to be accurate to real life and hence I wanted to use heightmaps and colormaps to generate them.

This has been previously done by a few people before.

If this is my map,

Then is there anyway to map it like this:

And get this?

Thanks for your help. Please tell me if this is the wrong category.

Try generating a smooth sphere shape and raycasting on different angles.

How would that work? Im talking about generating terrain using heightmaps, which are 2d images, so raycasts are completely useless.