# Converting from Mercator Projection to Latitude and Longitude

I have an image of (what I believe to be) a Mercator Projection map of Strangereal, from the Ace Combat game series. I have opened this map in GIMP and am reading pixel measurements for different locations. Ignoring the borders, the upper-left corner is (28, 28) and the lower-right corner is (9771, 5628). The equator is at y = 2818.

I am trying to take a given pixel measurement, say, Sand Island (3991, 2579), and convert it to latitude and longitude.

I know that the formulas for a Mercator projection are

$x = \lambda - \lambda_0$, $y = \log \tan(\pi/4 + \phi/2)$

$\phi = 2\arctan e^y - \pi/2$, $\lambda = x + \lambda_0$

where $\lambda$ is longitude, $\lambda_0$ is central meridian, $\phi$ is latitude, and $y=0$ is the equator.

Longitude is pretty simple: this map uses the left edge as 0 degrees and counts up to 360 degrees east. $\lambda = \frac{(3991-28)}{(9771-28)} \times 360^\circ = 146^\circ 25' 52'' \text{ E}$.

My problem is the latitude. With the equator at y = 2818, Sand Island is 239 pixels about the equator (or about 8.5% from the equator to the top of the map). What should I plug into the equation $\phi = 2\arctan \exp y - \pi/2$ to find its latitude?

(For reference, the "official" coordinates for Sand Island are $08^\circ 01' 13'' \text{ N, } 145^\circ 24' 34'' \text{ E}$, but the coordinate system is rough and inconsistent. That's why I'm doing the math myself. That, and I want other points on the earth.)