You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
firstly, thanks a lot for providing the python bindings for vips. They are really helpful 😄.
I am facing a library issue when trying to write a tiff image in tile-based fashion.
The use case:
I get tiles generated by some kind of source (e.g. a CV deep learning model). Since the composed image would be too large to fit in RAM, I want to write it to disk on a per-tile basis, but when reading the image again, I am getting a TIFFFillTile: Read error at row 896, col 896, tile 16; got 0 bytes, expected 49152.
This code is failing for me in the latest ubuntu docker image with the most recent vips release with the following error message:
Error Message:
> raise Error('unable to call {0}'.format(operation_name))
E pyvips.error.Error: unable to call VipsForeignSaveTiffFile
E TIFFFillTile: Read error at row 896, col 896, tile 16; got 0 bytes, expected 49152
Of course, it might be the case that my code for writing the image on a per-tile basis is just wrong, and I would need to write it differently. In both cases, help would be appreciated 👍.
Thanks for your time,
Martin
The text was updated successfully, but these errors were encountered:
MartinBuessemeyer
changed the title
TIFFFillTile: Read error when writing a TIFF file on a per-tile-basis.TIFFFillTile: Read error when writing a TIFF file on a per-tile basis.
May 8, 2024
Sorry, I don't think this is going to work :( The best you can do with pyvips is something like (untested!!):
tiles= [someexpressiontoyieldalistofnumpytiles]
# you can use `new_from_array` to make a vips image from a numpy array# they will share memory buffers, so there's no copying and it should be efficientimage=pyvips.Image.arrayjoin([pyvips.Image.new_from_array(tile) fortileintiles],
across=tile_across)
image.write_to_file("x.tif", tile=True, pyramid=True)
But this will unfortunately force the whole image into ram. You could test it and see how memory performance scales, but I fear it may not be good enough.
We've been talking about a better way to generate images like this, but it's not trivial and no one's done the work.
Hello People,
firstly, thanks a lot for providing the python bindings for vips. They are really helpful 😄.
I am facing a library issue when trying to write a tiff image in tile-based fashion.
The use case:
I get tiles generated by some kind of source (e.g. a CV deep learning model). Since the composed image would be too large to fit in RAM, I want to write it to disk on a per-tile basis, but when reading the image again, I am getting a
TIFFFillTile: Read error at row 896, col 896, tile 16; got 0 bytes, expected 49152
.I broke down the issue to a minimal code example:
This code is failing for me in the latest ubuntu docker image with the most recent vips release with the following error message:
Of course, it might be the case that my code for writing the image on a per-tile basis is just wrong, and I would need to write it differently. In both cases, help would be appreciated 👍.
Thanks for your time,
Martin
The text was updated successfully, but these errors were encountered: