MATLAB code to project an image on a sphere. testImage.png must be present in your current MATLAB directory. x,y,z are original coordinates,X,Y,Z are projected coordinates.
[x,y]=meshgrid(linspace(-pi,pi,200));
%formula for projection
X=(2*x)./(1+x.^2+y.^2);
Y=(2*y)./(1+x.^2+y.^2);
Z=(-1+x.^2+y.^2)./(1+x.^2+y.^2);
img=imread('testImage.png');
hold on
h=warp(X,Y,Z,img); %projected image
warp(x,y,-1*ones(size(x)),img); %default image
hold off
axis equal
set(gcf,'color',[1 1 1]);