How to implement pan/zoom on gigapixel bitmaps?

前端 未结 3 1571
庸人自扰
庸人自扰 2021-02-06 08:23

In my project, I\'m using (uncompressed 16-bit grayscale) gigapixel images which come from a high resolution scanner for measurement purposes. Since these bitmaps can not be loa

3条回答
  •  礼貌的吻别
    2021-02-06 08:49

    I guess you can address this issue following the steps below:

    1. Image generation:

      • segment your image in multiple subimages (tiles) of a small resolution, for instace, 500x500. These images are depth 0
      • combine a series of tiles with depth 0 (4x4 or 6x6), resize the combination generating a new tile with 500x500 pixels in depth 1.
      • continue with this approach until get the entire image using only a few tiles.
    2. Image visualization

      • Start from the highest depth
      • When user drags the image, load the tiles dynamically
      • When the user zoom a region of the image, decrease the depth, loading the tiles for that region in a higher resolution.

    The final result is similar to Google Maps.

提交回复
热议问题