PS about why i prefer map to a semisphere and not to the sphere

A flat projection of the semisphere will contain all the original image distorted how i wish while in case of a sphere only the half on the upper half of the sphere will be usable (and distortions too extreme )

UPDATE i may have part of the solution how map a square to a semi sphere and a rectangle to the correspondent semi ellipsoid

I failed to find the discussion on the formula to be applied but if may help i have as Mathmap code

The remaing problem is the progression a smooth transition from the Original Image to the resulting semi sphere or ellipsoidfilter rel2ellv3(image in)

xprime=x/sqrt(1-4*(y/H)*(y/H));

yprime=y/sqrt(1-4*(x/W)*(x/W));

in(xy:[xprime,yprime])

end

( And that if the rectangle is not a square result will be a semi ellipsoid and not a semisphere, but that do not worry me so much

...whenand ifneeded may be corrected simply scaling down only the larger side ,to make image's H and W equal)