How to setup a tile iterator to write to a file? #4080
jonasteuwen
started this conversation in
Help wanted
Replies: 1 comment 3 replies
-
Hello @jonasteuwen, Sorry, this won't work, the libvips design isn't really compatible with iterators. The libvips maintainers have talked about adding something like this several times, and (from memory) the current pipedream proposal would be for something like (using python for brevity): def generate_tile(region, left, top, width, height):
"""write pixels into region for this area
"""
image = pyvips.Image.new_from_generator(generate_tile,
width=1000, height=1000, bands=3,
format="uchar", interpretation="srgb")
image.write_to_file("something.tiff") But no one's done the work yet. |
Beta Was this translation helpful? Give feedback.
3 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
-
Previously I have asked #2860 how to setup a tile iterator for low memory saving of a tiff.
Currenty I am using libtiff to write tile-by-tile to a tiff file. However, I'm also using pyvips, so I wanted to replace the libtiff with a more general approach using libvips. I basically now want to have a python iterator which is written tile-by-tile to a tiff file.
Something like this:
Now, the FastTiffWriter is a C++ class like this:
(I have edited the post after asking ChatGPT for advice)
This hangs indefinitely at writing the tile vips_draw_image, this seems to result from my lack of understanding how I can handle the image so it gets data tile-by-tile and I'm able to write it this way.
How should you in general handle a tile-by-tile image?
Beta Was this translation helpful? Give feedback.
All reactions