We are currently solving the following issue within our repository. Here is the issue text:
--- BEGIN ISSUE ---
tifffile deprecation warning on test_tifffile.py
## Description

<!--
(Note: for guidance on how to use `scikit-image`, please post instead on https://forum.image.sc/tag/scikit-image)
-->

## Way to reproduce
```python
run pytest on skimage/io/tests/test_tifffile.py
```
Will show deprecation warning issues
```bash
skimage/io/tests/test_tifffile.py ...................................    [100%]

=============================== warnings summary ===============================
skimage/io/tests/test_tifffile.py::TestSave::test_imsave_roundtrip[False-float32-shape1]
skimage/io/tests/test_tifffile.py::TestSave::test_imsave_roundtrip[True-float32-shape1]
  /scikit-image/.venv/lib/python3.10/site-packages/tifffile/tifffile.py:1155: DeprecationWarning: <tifffile.TiffWriter.write> data with shape (10, 10, 3) and dtype 'float32' are stored as RGB with contiguous samples. Future versions will store such data as MINISBLACK in separate pages by default, unless the 'photometric' parameter is specified.
    result = tif.write(

skimage/io/tests/test_tifffile.py::TestSave::test_imsave_roundtrip[False-float32-shape2]
skimage/io/tests/test_tifffile.py::TestSave::test_imsave_roundtrip[True-float32-shape2]
  /scikit-image/.venv/lib/python3.10/site-packages/tifffile/tifffile.py:1155: DeprecationWarning: <tifffile.TiffWriter.write> data with shape (10, 10, 4) and dtype 'float32' are stored as RGB with contiguous samples. Future versions will store such data as MINISBLACK in separate pages by default, unless the 'photometric' parameter is specified.
    result = tif.write(

skimage/io/tests/test_tifffile.py::TestSave::test_imsave_roundtrip[False-int16-shape1]
skimage/io/tests/test_tifffile.py::TestSave::test_imsave_roundtrip[True-int16-shape1]
  /scikit-image/.venv/lib/python3.10/site-packages/tifffile/tifffile.py:1155: DeprecationWarning: <tifffile.TiffWriter.write> data with shape (10, 10, 3) and dtype 'int16' are stored as RGB with contiguous samples. Future versions will store such data as MINISBLACK in separate pages by default, unless the 'photometric' parameter is specified.
    result = tif.write(

skimage/io/tests/test_tifffile.py::TestSave::test_imsave_roundtrip[False-int16-shape2]
skimage/io/tests/test_tifffile.py::TestSave::test_imsave_roundtrip[True-int16-shape2]
  /scikit-image/.venv/lib/python3.10/site-packages/tifffile/tifffile.py:1155: DeprecationWarning: <tifffile.TiffWriter.write> data with shape (10, 10, 4) and dtype 'int16' are stored as RGB with contiguous samples. Future versions will store such data as MINISBLACK in separate pages by default, unless the 'photometric' parameter is specified.
    result = tif.write(

skimage/io/tests/test_tifffile.py::TestSave::test_imsave_roundtrip[False-float64-shape1]
skimage/io/tests/test_tifffile.py::TestSave::test_imsave_roundtrip[True-float64-shape1]
  /scikit-image/.venv/lib/python3.10/site-packages/tifffile/tifffile.py:1155: DeprecationWarning: <tifffile.TiffWriter.write> data with shape (10, 10, 3) and dtype 'float64' are stored as RGB with contiguous samples. Future versions will store such data as MINISBLACK in separate pages by default, unless the 'photometric' parameter is specified.
    result = tif.write(

skimage/io/tests/test_tifffile.py::TestSave::test_imsave_roundtrip[False-float64-shape2]
skimage/io/tests/test_tifffile.py::TestSave::test_imsave_roundtrip[True-float64-shape2]
  /scikit-image/.venv/lib/python3.10/site-packages/tifffile/tifffile.py:1155: DeprecationWarning: <tifffile.TiffWriter.write> data with shape (10, 10, 4) and dtype 'float64' are stored as RGB with contiguous samples. Future versions will store such data as MINISBLACK in separate pages by default, unless the 'photometric' parameter is specified.
    result = tif.write(

-- Docs: https://docs.pytest.org/en/stable/how-to/capture-warnings.html

```



--- END ISSUE ---

Below are some code segments, each from a relevant file. One or more of these files may contain bugs.
--- BEGIN FILES ---
Path: `skimage/io/_plugins/tifffile_plugin.py`
Content:
```
1 __all__ = ['imread', 'imsave']
2 
3 from tifffile import imwrite as imsave, imread as tifffile_imread
4 
5 
6 def imread(fname, **kwargs):
7     """Load a tiff image from file.
8 
9     Parameters
10     ----------
11     fname : str or file
12         File name or file-like-object.
13     kwargs : keyword pairs, optional
14         Additional keyword arguments to pass through (see ``tifffile``'s
15         ``imread`` function).
16 
17     Notes
18     -----
19     Provided by the tifffile library [1]_, and supports many
20     advanced image types including multi-page and floating point.
21 
22     References
23     ----------
24     .. [1] https://pypi.org/project/tifffile/
25 
26     """
27     if 'img_num' in kwargs:
28         kwargs['key'] = kwargs.pop('img_num')
29 
30     return tifffile_imread(fname, **kwargs)
31
```
--- END FILES ---

Please first localize the bug based on the issue statement, and then generate a patch according to the `git diff` format fenced by three backticks.

Here is an example:

```diff
diff --git a/examples/server_async.py b/examples/server_async.py
--- a/examples/server_async.py
+++ b/examples/server_async.py
@@ -313,4 +313,4 @@
 
 
 if __name__ == "__main__":
-    asyncio.run(run_async_server("."), debug=True)
+    asyncio.run(run_async_server(), debug=True)
diff --git a/examples/server_sync.py b/examples/server_sync.py
--- a/examples/server_sync.py
+++ b/examples/server_sync.py
@@ -313,5 +313,5 @@
 
 
 if __name__ == "__main__":
-    server = run_sync_server(".")
+    server = run_sync_server()
     server.shutdown()

```

diff --git a/skimage/io/_plugins/tifffile_plugin.py b/skimage/io/_plugins/tifffile_plugin.py
--- a/skimage/io/_plugins/tifffile_plugin.py
+++ b/skimage/io/_plugins/tifffile_plugin.py
@@ -1,6 +1,50 @@
+from tifffile import imread as tifffile_imread
+from tifffile import imwrite as tifffile_imwrite
+
 __all__ = ['imread', 'imsave']
 
-from tifffile import imwrite as imsave, imread as tifffile_imread
+
+def imsave(fname, arr, **kwargs):
+    """Load a tiff image to file.
+
+    Parameters
+    ----------
+    fname : str or file
+        File name or file-like object.
+    arr : ndarray
+        The array to write.
+    kwargs : keyword pairs, optional
+        Additional keyword arguments to pass through (see ``tifffile``'s
+        ``imwrite`` function).
+
+    Notes
+    -----
+    Provided by the tifffile library [1]_, and supports many
+    advanced image types including multi-page and floating-point.
+
+    This implementation will set ``photometric='RGB'`` when writing if the first
+    or last axis of `arr` has length 3 or 4. To override this, explicitly
+    pass the ``photometric`` kwarg.
+
+    This implementation will set ``planarconfig='SEPARATE'`` when writing if the
+    first axis of arr has length 3 or 4. To override this, explicitly
+    specify the ``planarconfig`` kwarg.
+
+    References
+    ----------
+    .. [1] https://pypi.org/project/tifffile/
+
+    """
+    if arr.shape[0] in [3, 4]:
+        if 'planarconfig' not in kwargs:
+            kwargs['planarconfig'] = 'SEPARATE'
+        rgb = True
+    else:
+        rgb = arr.shape[-1] in [3, 4]
+    if rgb and 'photometric' not in kwargs:
+        kwargs['photometric'] = 'RGB'
+
+    return tifffile_imwrite(fname, arr, **kwargs)
 
 
 def imread(fname, **kwargs):

{"golden_diff": "diff --git a/skimage/io/_plugins/tifffile_plugin.py b/skimage/io/_plugins/tifffile_plugin.py\n--- a/skimage/io/_plugins/tifffile_plugin.py\n+++ b/skimage/io/_plugins/tifffile_plugin.py\n@@ -1,6 +1,50 @@\n+from tifffile import imread as tifffile_imread\n+from tifffile import imwrite as tifffile_imwrite\n+\n __all__ = ['imread', 'imsave']\n \n-from tifffile import imwrite as imsave, imread as tifffile_imread\n+\n+def imsave(fname, arr, **kwargs):\n+    \"\"\"Load a tiff image to file.\n+\n+    Parameters\n+    ----------\n+    fname : str or file\n+        File name or file-like object.\n+    arr : ndarray\n+        The array to write.\n+    kwargs : keyword pairs, optional\n+        Additional keyword arguments to pass through (see ``tifffile``'s\n+        ``imwrite`` function).\n+\n+    Notes\n+    -----\n+    Provided by the tifffile library [1]_, and supports many\n+    advanced image types including multi-page and floating-point.\n+\n+    This implementation will set ``photometric='RGB'`` when writing if the first\n+    or last axis of `arr` has length 3 or 4. To override this, explicitly\n+    pass the ``photometric`` kwarg.\n+\n+    This implementation will set ``planarconfig='SEPARATE'`` when writing if the\n+    first axis of arr has length 3 or 4. To override this, explicitly\n+    specify the ``planarconfig`` kwarg.\n+\n+    References\n+    ----------\n+    .. [1] https://pypi.org/project/tifffile/\n+\n+    \"\"\"\n+    if arr.shape[0] in [3, 4]:\n+        if 'planarconfig' not in kwargs:\n+            kwargs['planarconfig'] = 'SEPARATE'\n+        rgb = True\n+    else:\n+        rgb = arr.shape[-1] in [3, 4]\n+    if rgb and 'photometric' not in kwargs:\n+        kwargs['photometric'] = 'RGB'\n+\n+    return tifffile_imwrite(fname, arr, **kwargs)\n \n \n def imread(fname, **kwargs):\n", "issue": "tifffile deprecation warning on test_tifffile.py\n## Description\r\n\r\n<!--\r\n(Note: for guidance on how to use `scikit-image`, please post instead on https://forum.image.sc/tag/scikit-image)\r\n-->\r\n\r\n## Way to reproduce\r\n```python\r\nrun pytest on skimage/io/tests/test_tifffile.py\r\n```\r\nWill show deprecation warning issues\r\n```bash\r\nskimage/io/tests/test_tifffile.py ...................................    [100%]\r\n\r\n=============================== warnings summary ===============================\r\nskimage/io/tests/test_tifffile.py::TestSave::test_imsave_roundtrip[False-float32-shape1]\r\nskimage/io/tests/test_tifffile.py::TestSave::test_imsave_roundtrip[True-float32-shape1]\r\n  /scikit-image/.venv/lib/python3.10/site-packages/tifffile/tifffile.py:1155: DeprecationWarning: <tifffile.TiffWriter.write> data with shape (10, 10, 3) and dtype 'float32' are stored as RGB with contiguous samples. Future versions will store such data as MINISBLACK in separate pages by default, unless the 'photometric' parameter is specified.\r\n    result = tif.write(\r\n\r\nskimage/io/tests/test_tifffile.py::TestSave::test_imsave_roundtrip[False-float32-shape2]\r\nskimage/io/tests/test_tifffile.py::TestSave::test_imsave_roundtrip[True-float32-shape2]\r\n  /scikit-image/.venv/lib/python3.10/site-packages/tifffile/tifffile.py:1155: DeprecationWarning: <tifffile.TiffWriter.write> data with shape (10, 10, 4) and dtype 'float32' are stored as RGB with contiguous samples. Future versions will store such data as MINISBLACK in separate pages by default, unless the 'photometric' parameter is specified.\r\n    result = tif.write(\r\n\r\nskimage/io/tests/test_tifffile.py::TestSave::test_imsave_roundtrip[False-int16-shape1]\r\nskimage/io/tests/test_tifffile.py::TestSave::test_imsave_roundtrip[True-int16-shape1]\r\n  /scikit-image/.venv/lib/python3.10/site-packages/tifffile/tifffile.py:1155: DeprecationWarning: <tifffile.TiffWriter.write> data with shape (10, 10, 3) and dtype 'int16' are stored as RGB with contiguous samples. Future versions will store such data as MINISBLACK in separate pages by default, unless the 'photometric' parameter is specified.\r\n    result = tif.write(\r\n\r\nskimage/io/tests/test_tifffile.py::TestSave::test_imsave_roundtrip[False-int16-shape2]\r\nskimage/io/tests/test_tifffile.py::TestSave::test_imsave_roundtrip[True-int16-shape2]\r\n  /scikit-image/.venv/lib/python3.10/site-packages/tifffile/tifffile.py:1155: DeprecationWarning: <tifffile.TiffWriter.write> data with shape (10, 10, 4) and dtype 'int16' are stored as RGB with contiguous samples. Future versions will store such data as MINISBLACK in separate pages by default, unless the 'photometric' parameter is specified.\r\n    result = tif.write(\r\n\r\nskimage/io/tests/test_tifffile.py::TestSave::test_imsave_roundtrip[False-float64-shape1]\r\nskimage/io/tests/test_tifffile.py::TestSave::test_imsave_roundtrip[True-float64-shape1]\r\n  /scikit-image/.venv/lib/python3.10/site-packages/tifffile/tifffile.py:1155: DeprecationWarning: <tifffile.TiffWriter.write> data with shape (10, 10, 3) and dtype 'float64' are stored as RGB with contiguous samples. Future versions will store such data as MINISBLACK in separate pages by default, unless the 'photometric' parameter is specified.\r\n    result = tif.write(\r\n\r\nskimage/io/tests/test_tifffile.py::TestSave::test_imsave_roundtrip[False-float64-shape2]\r\nskimage/io/tests/test_tifffile.py::TestSave::test_imsave_roundtrip[True-float64-shape2]\r\n  /scikit-image/.venv/lib/python3.10/site-packages/tifffile/tifffile.py:1155: DeprecationWarning: <tifffile.TiffWriter.write> data with shape (10, 10, 4) and dtype 'float64' are stored as RGB with contiguous samples. Future versions will store such data as MINISBLACK in separate pages by default, unless the 'photometric' parameter is specified.\r\n    result = tif.write(\r\n\r\n-- Docs: https://docs.pytest.org/en/stable/how-to/capture-warnings.html\r\n\r\n```\r\n\r\n\n", "before_files": [{"content": "__all__ = ['imread', 'imsave']\n\nfrom tifffile import imwrite as imsave, imread as tifffile_imread\n\n\ndef imread(fname, **kwargs):\n    \"\"\"Load a tiff image from file.\n\n    Parameters\n    ----------\n    fname : str or file\n        File name or file-like-object.\n    kwargs : keyword pairs, optional\n        Additional keyword arguments to pass through (see ``tifffile``'s\n        ``imread`` function).\n\n    Notes\n    -----\n    Provided by the tifffile library [1]_, and supports many\n    advanced image types including multi-page and floating point.\n\n    References\n    ----------\n    .. [1] https://pypi.org/project/tifffile/\n\n    \"\"\"\n    if 'img_num' in kwargs:\n        kwargs['key'] = kwargs.pop('img_num')\n\n    return tifffile_imread(fname, **kwargs)\n", "path": "skimage/io/_plugins/tifffile_plugin.py"}], "after_files": [{"content": "from tifffile import imread as tifffile_imread\nfrom tifffile import imwrite as tifffile_imwrite\n\n__all__ = ['imread', 'imsave']\n\n\ndef imsave(fname, arr, **kwargs):\n    \"\"\"Load a tiff image to file.\n\n    Parameters\n    ----------\n    fname : str or file\n        File name or file-like object.\n    arr : ndarray\n        The array to write.\n    kwargs : keyword pairs, optional\n        Additional keyword arguments to pass through (see ``tifffile``'s\n        ``imwrite`` function).\n\n    Notes\n    -----\n    Provided by the tifffile library [1]_, and supports many\n    advanced image types including multi-page and floating-point.\n\n    This implementation will set ``photometric='RGB'`` when writing if the first\n    or last axis of `arr` has length 3 or 4. To override this, explicitly\n    pass the ``photometric`` kwarg.\n\n    This implementation will set ``planarconfig='SEPARATE'`` when writing if the\n    first axis of arr has length 3 or 4. To override this, explicitly\n    specify the ``planarconfig`` kwarg.\n\n    References\n    ----------\n    .. [1] https://pypi.org/project/tifffile/\n\n    \"\"\"\n    if arr.shape[0] in [3, 4]:\n        if 'planarconfig' not in kwargs:\n            kwargs['planarconfig'] = 'SEPARATE'\n        rgb = True\n    else:\n        rgb = arr.shape[-1] in [3, 4]\n    if rgb and 'photometric' not in kwargs:\n        kwargs['photometric'] = 'RGB'\n\n    return tifffile_imwrite(fname, arr, **kwargs)\n\n\ndef imread(fname, **kwargs):\n    \"\"\"Load a tiff image from file.\n\n    Parameters\n    ----------\n    fname : str or file\n        File name or file-like-object.\n    kwargs : keyword pairs, optional\n        Additional keyword arguments to pass through (see ``tifffile``'s\n        ``imread`` function).\n\n    Notes\n    -----\n    Provided by the tifffile library [1]_, and supports many\n    advanced image types including multi-page and floating point.\n\n    References\n    ----------\n    .. [1] https://pypi.org/project/tifffile/\n\n    \"\"\"\n    if 'img_num' in kwargs:\n        kwargs['key'] = kwargs.pop('img_num')\n\n    return tifffile_imread(fname, **kwargs)\n", "path": "skimage/io/_plugins/tifffile_plugin.py"}]}