Here is how to do that in Imagemagick. It can be done in Python/OpenCV, but I do not have the time now to implement it. It is pretty easy in Imagemagick using one of my bash shell scripts to do the spherize of the texture.
(I show how to do the spherical distortion in Python/OpenCV at How make eye and nose bigger or smaller in opencv and python in a previous post. And an example showing how to do the hard light composite in Python/OpenCV is in How to augment scanned document image with creases, folds and wrinkles?)
Sphere Image:
Texture Image:
convert sphere.png -trim +repage sphere_trim.png
convert texture.jpg -resize 1375x1375^ -gravity center -crop 1375x1375+0+0 +repage texture_resize_crop.jpg
spherize -a 1 -b white texture_resize_crop.jpg texture_resize_crop_spherize_a1.jpg
convert texture_resize_crop_spherize_a1.jpg \
sphere_trim.png \
\( +clone -alpha extract +write mpr:alpha +delete \) -alpha off \
\( +clone \) \
-compose hardlight -composite \
mpr:alpha -alpha off -compose over -compose copy_opacity -composite \
sphere_texture.png
Trimmed Sphere Image:
Resized and Cropped Texture Image:
Spherized Texture Image:
Result From Hardlight Composite: