title: How to edit tiff tags without loading the image into memory
body: <p>I am trying to modify the tags of a saved image. In particular I would like to change the pixel resolution tag. I have previously done it with the <code>tifffile</code> package by loading the image into memory and then saving the file with the new pixel resolution included as a parameter.</p>
  <pre><code>from tifffile import TiffWriter:
  from imageio import imread
  image = imread('image.tif')
  with TiffWriter(filename) as tif_w:
      tif_w.write(image,
                  resolution=resolution)
  </code></pre>
  <p>This method works well, but The image I am reading in is almost 1GB large so this method is rather slow. I am wondering if anyone has a method for simply editing the tag within the save file without rewriting the full file? I have tried the following method using <code>tifffile.TiffTags</code>, but I get the following error.</p>
  <pre><code>import tifffile
  import imageio as io
  import numpy as np
  image = np.zeros(shape=(1000, 1000), dtype=np.uint8)
  io.imwrite('image.tif', image)
  tiff = tifffile.TiffFile('image.tif', 'wb')
  tiff.pages[0].tags['XResolution'].overwrite(tiff, (97321972, 392185))
  Traceback (most recent call last):
    File &quot;&lt;input&gt;&quot;, line 8, in &lt;module&gt;
    File &quot;/home/jed/miniconda3/envs/mcam_dev/lib/python3.8/site-packages/tifffile/tifffile.py&quot;, line 7578, in overwrite
      fh.write(struct.pack(tiff.offsetformat, count))
    File &quot;/home/jed/miniconda3/envs/mcam_dev/lib/python3.8/site-packages/tifffile/tifffile.py&quot;, line 8939, in write
      return self._fh.write(bytestring)
  io.UnsupportedOperation: write
  </code></pre>
  <p>Thanks in advance for the help!</p>