How to obtain the progress of saving images using the "tiffsave"? #4571
Replies: 6 comments 9 replies
-
If I use the "tiffsave" function to save ome.tif of a pyramid image, can I save only a small area at a time and trigger a new save only when the image content of the remaining areas is generated, or can I save only one band at a time and trigger a new band save only after another band is generated? My goal is to reduce the save time of tiffsave, because images are not generated all at once, but are generated part by part, band by band. Is there a way? Thank you |
Beta Was this translation helpful? Give feedback.
-
If all the experts could spare valuable time to help solve the above two problems, I would truly be grateful. |
Beta Was this translation helpful? Give feedback.
-
Hi @zjian361, There's some example code here: https://github.com/libvips/libvips/blob/master/examples/progress-cancel.c
I'm not sure I understand your second question, sorry. |
Beta Was this translation helpful? Give feedback.
-
For writing OME-TIFF, one of the expensive parts is splitting the bands into a mono vertical strip. You can sometimes speed it up by writing the processing before the split to a temporary file, then building the strip and the pyramid from that. |
Beta Was this translation helpful? Give feedback.
-
For example, I have two images, one in the upper left corner called 1.ometif and the other in the lower right corner called 2.ome.tif. They actually form a large image together, logically part of the same image, and there is also an entry file that together make up this large image. Are there any standards and examples for similar situations? Actually, my main purpose is to speed up storage because I can only retrieve 1.ome.tif first, which takes a long time to retrieve 2.ome.tif, so that I can store part by part.
…---- Replied Message ----
| From | John ***@***.***> |
| Date | 07/21/2025 21:46 |
| To | ***@***.***> |
| Cc | ***@***.***>***@***.***> |
| Subject | Re: [libvips/libvips] How to obtain the progress of saving images using the "tiffsave"? (Discussion #4571) |
Do you mean slicing an image into a regular grid? dzsave can do this.
$ vips dzsave k2.jpg x --depth one --overlap 0
$ ls x_files/0
0_0.jpeg 0_7.jpeg 1_5.jpeg 2_3.jpeg 3_1.jpeg 3_8.jpeg 4_6.jpeg 5_4.jpeg
0_1.jpeg 0_8.jpeg 1_6.jpeg 2_4.jpeg 3_2.jpeg 4_0.jpeg 4_7.jpeg 5_5.jpeg
0_2.jpeg 1_0.jpeg 1_7.jpeg 2_5.jpeg 3_3.jpeg 4_1.jpeg 4_8.jpeg 5_6.jpeg
0_3.jpeg 1_1.jpeg 1_8.jpeg 2_6.jpeg 3_4.jpeg 4_2.jpeg 5_0.jpeg 5_7.jpeg
0_4.jpeg 1_2.jpeg 2_0.jpeg 2_7.jpeg 3_5.jpeg 4_3.jpeg 5_1.jpeg 5_8.jpeg
0_5.jpeg 1_3.jpeg 2_1.jpeg 2_8.jpeg 3_6.jpeg 4_4.jpeg 5_2.jpeg
0_6.jpeg 1_4.jpeg 2_2.jpeg 3_0.jpeg 3_7.jpeg 4_5.jpeg 5_3.jpeg
—
Reply to this email directly, view it on GitHub, or unsubscribe.
You are receiving this because you were mentioned.Message ID: ***@***.***>
|
Beta Was this translation helpful? Give feedback.
-
Is there such an image storage method: using multiple files to store a large image, with an entrance file, the image viewing software can open the entire image by reading the entrance file. These files are logically a large image.
…---- Replied Message ----
| From | John ***@***.***> |
| Date | 07/21/2025 22:22 |
| To | ***@***.***> |
| Cc | ***@***.***>***@***.***> |
| Subject | Re: [libvips/libvips] How to obtain the progress of saving images using the "tiffsave"? (Discussion #4571) |
You can just join them together. Would that work?
In python:
# make a *HUGE* black imageimage=pyvips.Image.black(100000, 100000)
# position the first image at the top lefta=pyvips.Image.new_from_file("1.ometif")
image=image.insert(a, 0, 0)
# and the second at the bottom rightb=pyvips.Image.new_from_file("2.ometif")
image=image.insert(b, image.width-b.width, image.height-b.height)
libvips will execute this efficiently -- it'll load a and b on demand, and one tile at a time. It'll never really make the whole image.
I'm probably misunderstanding you!
—
Reply to this email directly, view it on GitHub, or unsubscribe.
You are receiving this because you were mentioned.Message ID: ***@***.***>
|
Beta Was this translation helpful? Give feedback.
Uh oh!
There was an error while loading. Please reload this page.
-
The type of the m_wholeImg variable is VIPS:: VImage.How to obtain the progress of saving images using the "tiffsave"?I used like this:
m_wholeImg.tiffsave(("//result.ome.tif",vips::VImage::option()->set("compression", "jpeg")->set("tile", true)->set("subifd", true)->set("tile_width", 512)->set("tile_height", 512)->set("pyramid", true)->set("properties", true)->set("bigtiff", false));
Beta Was this translation helpful? Give feedback.
All reactions