openzoom / deepzoom.py Goto Github PK
View Code? Open in Web Editor NEWPython Deep Zoom Tools
Home Page: http://openzoom.org/
License: Other
Python Deep Zoom Tools
Home Page: http://openzoom.org/
License: Other
Are these formats supported? Tiling, compression?
When I try to generate a DZI from the file available at https://www.sendspace.com/file/yskm3h, I get the exception ValueError: image has wrong mode
:
from deepzoom import ImageCreator
creator = ImageCreator()
source = "/path/to/image"
destination = "/path/to/dzi"
creator.create(source=source, destination=destination)
Here's the traceback:
---------------------------------------------------------------------------
ValueError Traceback (most recent call last)
<ipython-input-5-9003b8af8c39> in <module>
----> 1 creator.create(source=input, destination=output)
~/path/to/virtualenv/src/deepzoomtools/deepzoom/__init__.py in create(self, source, destination)
424 for level in range(self.descriptor.num_levels):
425 level_dir = _get_or_create_path(os.path.join(image_files, str(level)))
--> 426 level_image = self.get_image(level)
427 for (column, row) in self.tiles(level):
428 bounds = self.descriptor.get_tile_bounds(level, column, row)
~/path/to/virtualenv/src/deepzoomtools/deepzoom/__init__.py in get_image(self, level)
399 return self.image
400 if (self.resize_filter is None) or (self.resize_filter not in RESIZE_FILTERS):
--> 401 return self.image.resize((width, height), PIL.Image.ANTIALIAS)
402 return self.image.resize((width, height), RESIZE_FILTERS[self.resize_filter])
403
~/path/to/virtualenv/lib/python3.9/site-packages/PIL/Image.py in resize(self, size, resample, box, reducing_gap)
1927 )
1928
-> 1929 return self._new(self.im.resize(size, resample, box))
1930
1931 def reduce(self, factor, box=None):
ValueError: image has wrong mode
Do you have an idea why this happening?
this script works awesome! It would be nice though if it spit out some sort of progress meter to the command line. Anything would be fine. just something to tell you it isn't hung up. sometimes it runs for up to 4 hours on my machine. would be cool if it just said like
tile 01 of 450 complete
tile 02 of 450 complete
and so on.
or even just a 1% done would be great.
otherwise, I really like this script and it works fine!
thanks,
C
An optional function that gets called after each tile gets created (but before it gets saved), so you can run whatever filter you want on it. Should be given the tile, level, and location.
when i am executing "python ./helloworld-dzi.py" i am getting below error. Can you please tell me how can i solve this ?
creator = deepzoom.ImageCreator(
^^^^^^^^^^^^^^^^^^^^^
AttributeError: module 'deepzoom' has no attribute 'ImageCreator'
I had to install Pillow as pil is no longer availabe, also openzoom.org is down.
Hi,
is it possible to install and run deepzoom.py with python 3? I get some errors, for example that there is no module StringIO and that xrange is not defined.
Trying to run it with Python 2.7; I also get errors. I used the module some years ago and it worked (so I'll try to use an older release as a workaround in the meanwhile)
Presumably anything that's too large to fit in RAM.
One possibility (though I haven't played with it): http://www.vips.ecs.soton.ac.uk/ by @jcupitt
An optional parameter for how much sharpening to add to each tile after it's been created.
Using the latest version obtained in git today I have used the XML generated with Salado Player to display panoramic spherical images. The XML contains a typographic error that causes Salado Player to not find the images. Where it should be writen "xmnls" it is writen "xmlns" to point to the schema at the microsoft site.
I've got ~6000 images at 1000x1000 pixels. I'm first making a large montage of 6Gpixels and then apply deepzoom.py
. Everything works great but I'm wondering whether it's possible at all to omit the step of making the big montage and make a single tiling from individual images?
Code in ImageCreator.create (lines 213-216):
if self.descriptor.tile_format == "jpg":
tile.save(tile_file, "JPEG",
quality=int(self.image_quality * 100))
tile.save(tile_file)
saves JPEG image twice, causing unpredictable hangups of Seadragon AJAX in Firefox 3.6. Furthermore, size of DeepZoom folders almost doubles.
Code below fixes the case:
if self.descriptor.tile_format == "jpg":
tile.save(tile_file, "JPEG",
quality=int(self.image_quality * 100))
else:
tile.save(tile_file)
Given a DZI of PNGs, replace them all with JPGs and update the XML.
Any chance this project could be put on pypi?
Thank you, works fine. I would like dzi of
I have successfully made a 400px width dzi with deepzoom.
Can you also give image_quality=0.8 max setting?
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.