Metadata: Is an existing JPEG-compressed PTIFF re-compressed when only modifying its metadata payloads? #4567
Unanswered
bluebinary
asked this question in
Q&A
Replies: 1 comment
-
Also asked here: |
Beta Was this translation helpful? Give feedback.
0 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.
-
I would like to ask the VIPS community, does anyone know if image data is decompressed and recompressed when opening and saving an existing Pyramidal TIFF (PTIFF) file that has been compressed using JPEG, if the only operation on the image between opening and closing it is to modify one or more of its embedded metadata payloads?
I am concerned that the current VIPS processing pipeline seems to suggest that this operation would be lossy, even though I am not performing any image transformation steps, and I wonder are there any configuration options or adjustments I could make to ensure that the image data is not modified when only the metadata is being modified.
Here is a Python code sample, illustrated using
pyvips
to show the exact steps I am talking about:It should be noted that I am able to successfully update the embedded metadata within a PTIFF using the above steps.
However, I would love to know how I can open an existing PTIFF file, update one or more of its embedded metadata payloads, and then save the image without incurring the presumed penalty of the image canvases held within the PTIFF file from being decompressed and then recompressed, which over time will inevitably lead to image artefacting, given that JPEG compression is being used for these PTIFF files.
We have a workflow were it is expensive to generate the PTIFFs from source, and we would like to avoid having to do this unnecessarily if possible, while the embedded metadata could change with some regularity, and thus it is quite likely for any given image that we may need to refresh its embedded image metadata dozens of times. As such any possible image artefacting caused by decompression and recompression could accumulate over time, impacting the quality of the images.
I don't mind if I have to use entirely different VIPS operations to achieve the desired end-result.
For example is there an operation that I can use other than
tiffsave()
to resave the image held in memory back to disk?I presume if any of the steps in the above code sample are responsible for the re-encoding of the image (and possible quality degradation over time), it would be the
tiffsave()
step.Thank you kindly for any suggestions or recommendations on how the above workflow could be achieved with VIPS.
Beta Was this translation helpful? Give feedback.
All reactions