Regarding DZI, Microsoft has prepared it rather than explaining it to me. I think it's faster to see the page .
The idea is that the area that can be displayed on one screen even if the image is 100MB per image is about 1MB, so it is only necessary to divide it into 1000 and read only the display area. It's rough.
Isn't it more difficult to display a program than to create data? Those who think </ strong> are correct. I published it in another article " Try using a Google Maps-like open source high-resolution image viewer ". I made my own with ActionScript and CoffeeScript respectively, but I would like to introduce it at another time along with the sad background that I did not know the DZI format.
Let's get back to DZI. The tool for creating DZI files is already made in Python , so download it and try it out.
Please refer to the README for how to install PIL.
The contents of the sample program are so simple that it is not necessary to explain it. Take a look at examples / helloworld / helloworld.py.
!/usr/bin/env python -*- coding: utf-8 -*- import deepzoom Specify your source image SOURCE = "helloworld.jpg " Create Deep Zoom Image creator with weird parameters creator = deepzoom.ImageCreator(tile_size=128, tile_overlap=2, tile_format="png", image_quality=0.8, resize_filter="bicubic") Create Deep Zoom image pyramid from source creator.create(SOURCE, "helloworld.dzi")
It's almost okay if you change the input image and the output image ... Let's check the options of ImageCreater for the time being.
Here, according to the notation of OpenZoom , the image divided into squares is called a "tile".
tile_size How many px should the image be divided vertically and horizontally? DZI tiles are basically square.
tile_overlap This is faster if you look at the image.
If you divide the tiles without margins (what should I call them) and arrange them, you may get flicker. To prevent this, the option to split larger than tile_size is called tile overlap.
tile_format Read this as it is. This time, it is output as png, but it can also be output as jpg.
image_quality This is also the same. Image quality specification. 1 is the upper limit.
resize_filter I'm too specialized in this and I don't know everything, but if you want to know more, please see below. http://www.dfx.co.jp/dftalk/?p=13061
If you are not particular about it, bicubic is fine.
There are other detailed arrangements, so if you would like to know more, please see below. http://www.openzoom.org/
Now, after specifying the options, input image, and output file name, just tap
$ python helloworld.py
You should now have a DZI file and a filename_images directory in the same directory.
The viewer will be explained in " Try using a Google Maps-like open source high-resolution image viewer ".
Thank you for your support.
Recommended Posts