Hello Nate,
I was looking for such a solution for similar problems with flat images and found it here, and Thank You,Your solution is working awesome and I find it a great help.
Except I am facing a small problem, I don't have a proper square dimensional image, but I have an image with res 1984x3062.
gdal2tiles generates square tiles of 256x256 px and it adds transparent sections in the tiles to compensate for the non-square image.
And if such tiles are used in leafletjs with flat_image_zoom.js , the image appears to be placed at a distance from top, giving the illusion that the image isn't centered, this also causes issues in viewing the image.
So I would really love to know if you have a solution for non-squared images.
Thank You