For large image sizes, just like yours, you will be best off working with lossless JPEG editing. This is not only faster because the image does not need to be rendered, but it also retains quality because the image is not compressed.
Lossless processing works on blocks, usually 16 pixels square. Although this is a limitation for some applications, this seems like a good help for matching. You can implement tiles with different zoom levels, first cropping the image to size without loss. (This is quickly effective because the image is not displayed.) It gives you fragments for full-scale scaling. To create a lower zoom level, combine 2x2 tiles and scale them to the size of 1 tile. The next level uses 4x4 tiles and 8x8, etc., each time reducing to one tile. At some point, when the number of tiles is too large, you can use scaled tiles as a base resource. For example, when scaling 8, which requires 256x256 tiles. This may be too much to process, so you can use 16x16 tiles from level 4.
Wikipedia is more about lossless editing and links to some executing libraries.
source share