We are currently solving the following issue within our repository. Here is the issue text:
--- BEGIN ISSUE ---
`toga.Image()` doesn't accept `None` as a value for `src`
### Describe the bug

`toga.Image()` doesn't accept `None` as a value for `src`, but according to the docs and code: https://github.com/beeware/toga/blob/61dff563d82da71bd2470cde27882731113eda2d/core/src/toga/images.py#L42C9-L42C41 it should accept `None` as a value.

### Steps to reproduce

1. Clone latest toga/main branch
2. `pip install -e ./core -e ./dummy -e ./gtk`
3. Create a new briefcase project
4. Use the following `app.py` script:
```
"""
My first application
"""
import toga
from toga.style import Pack
from toga.style.pack import COLUMN, ROW


class HelloWorld(toga.App):

    def startup(self):
        """
        Construct and show the Toga application.

        Usually, you would add your application to a main content box.
        We then create a main window (with a name matching the app), and
        show the main window.
        """
        main_box = toga.Box()
        img = toga.Image(src=None)
        self.main_window = toga.MainWindow(title=self.formal_name)
        self.main_window.content = main_box
        self.main_window.show()


def main():
    return HelloWorld()
```

5. `briefcase dev`
6. Error encountered:
```

[helloworld] Starting in dev mode...
===========================================================================
Traceback (most recent call last):
  File "/home/proneon267/Pictures/venv/lib/python3.11/site-packages/toga_gtk/app.py", line 87, in gtk_startup
    self.interface._startup()
  File "/home/proneon267/Pictures/venv/lib/python3.11/site-packages/toga/app.py", line 629, in _startup
    self.startup()
  File "/home/proneon267/Pictures/toga/helloworld/src/helloworld/app.py", line 20, in startup
    img = toga.Image(src=None)
          ^^^^^^^^^^^^^^^^^^^^
  File "/home/proneon267/Pictures/venv/lib/python3.11/site-packages/toga/images.py", line 63, in __init__
    raise TypeError(
TypeError: Image.__init__() missing 1 required positional argument: 'src'
```


### Expected behavior

`toga.Image()` should accept `None` as a value for `src`

### Screenshots

_No response_

### Environment

- Operating System: Arch
- Python version: 3.11.6
- Software versions:
  - Briefcase: 0.3.16
  - Toga: latest
  - ...


### Logs

```
No log files were generated.
```


### Additional context

_No response_

--- END ISSUE ---

Below are some code segments, each from a relevant file. One or more of these files may contain bugs.
--- BEGIN FILES ---
Path: `core/src/toga/images.py`
Content:
```
1 from __future__ import annotations
2 
3 import sys
4 import warnings
5 from io import BytesIO
6 from pathlib import Path
7 from typing import TYPE_CHECKING, Any
8 from warnings import warn
9 
10 try:
11     import PIL.Image
12 
13     PIL_imported = True
14 except ImportError:  # pragma: no cover
15     PIL_imported = False
16 
17 import toga
18 from toga.platform import get_platform_factory
19 
20 # Make sure deprecation warnings are shown by default
21 warnings.filterwarnings("default", category=DeprecationWarning)
22 
23 if TYPE_CHECKING:
24     if sys.version_info < (3, 10):
25         from typing_extensions import TypeAlias, TypeVar
26     else:
27         from typing import TypeAlias, TypeVar
28 
29     # Define a type variable for generics where an Image type is required.
30     ImageT = TypeVar("ImageT")
31 
32     # Define the types that can be used as Image content
33     PathLike: TypeAlias = str | Path
34     BytesLike: TypeAlias = bytes | bytearray | memoryview
35     ImageLike: TypeAlias = Any
36     ImageContent: TypeAlias = PathLike | BytesLike | ImageLike
37 
38 
39 class Image:
40     def __init__(
41         self,
42         src: ImageContent | None = None,
43         *,
44         path=None,  # DEPRECATED
45         data=None,  # DEPRECATED
46     ):
47         """Create a new image.
48 
49         :param src: The source from which to load the image. Can be any valid
50             :any:`image content <ImageContent>` type.
51         :param path: **DEPRECATED** - Use ``src``.
52         :param data: **DEPRECATED** - Use ``src``.
53         :raises FileNotFoundError: If a path is provided, but that path does not exist.
54         :raises ValueError: If the source cannot be loaded as an image.
55         """
56         ######################################################################
57         # 2023-11: Backwards compatibility
58         ######################################################################
59         num_provided = sum(arg is not None for arg in (src, path, data))
60         if num_provided > 1:
61             raise ValueError("Received multiple arguments to constructor.")
62         if num_provided == 0:
63             raise TypeError(
64                 "Image.__init__() missing 1 required positional argument: 'src'"
65             )
66         if path is not None:
67             src = path
68             warn(
69                 "Path argument is deprecated, use src instead.",
70                 DeprecationWarning,
71                 stacklevel=2,
72             )
73         elif data is not None:
74             src = data
75             warn(
76                 "Data argument is deprecated, use src instead.",
77                 DeprecationWarning,
78                 stacklevel=2,
79             )
80         ######################################################################
81         # End backwards compatibility
82         ######################################################################
83 
84         self.factory = get_platform_factory()
85         self._path = None
86 
87         # Any "lump of bytes" should be valid here.
88         if isinstance(src, (bytes, bytearray, memoryview)):
89             self._impl = self.factory.Image(interface=self, data=src)
90 
91         elif isinstance(src, (str, Path)):
92             self._path = toga.App.app.paths.app / src
93             if not self._path.is_file():
94                 raise FileNotFoundError(f"Image file {self._path} does not exist")
95             self._impl = self.factory.Image(interface=self, path=self._path)
96 
97         elif isinstance(src, Image):
98             self._impl = self.factory.Image(interface=self, data=src.data)
99 
100         elif PIL_imported and isinstance(src, PIL.Image.Image):
101             buffer = BytesIO()
102             src.save(buffer, format="png", compress_level=0)
103             self._impl = self.factory.Image(interface=self, data=buffer.getvalue())
104 
105         elif isinstance(src, self.factory.Image.RAW_TYPE):
106             self._impl = self.factory.Image(interface=self, raw=src)
107 
108         else:
109             raise TypeError("Unsupported source type for Image")
110 
111     @property
112     def size(self) -> (int, int):
113         """The size of the image, as a (width, height) tuple."""
114         return (self._impl.get_width(), self._impl.get_height())
115 
116     @property
117     def width(self) -> int:
118         """The width of the image, in pixels."""
119         return self._impl.get_width()
120 
121     @property
122     def height(self) -> int:
123         """The height of the image, in pixels."""
124         return self._impl.get_height()
125 
126     @property
127     def data(self) -> bytes:
128         """The raw data for the image, in PNG format."""
129         return self._impl.get_data()
130 
131     @property
132     def path(self) -> Path | None:
133         """The path from which the image was opened, if any (or None)."""
134         return self._path
135 
136     def save(self, path: str | Path) -> None:
137         """Save image to given path.
138 
139         The file format of the saved image will be determined by the extension of
140         the filename provided (e.g ``path/to/mypicture.png`` will save a PNG file).
141 
142         :param path: Path to save the image to.
143         """
144         self._impl.save(path)
145 
146     def as_format(self, format: type[ImageT]) -> ImageT:
147         """Return the image, converted to the image format specified.
148 
149         :param format: The image class to return. Currently supports only :any:`Image`,
150             and :any:`PIL.Image.Image` if Pillow is installed.
151         :returns: The image in the requested format
152         :raises TypeError: If the format supplied is not recognized.
153         """
154         if isinstance(format, type) and issubclass(format, Image):
155             return format(self.data)
156 
157         if PIL_imported and format is PIL.Image.Image:
158             buffer = BytesIO(self.data)
159             with PIL.Image.open(buffer) as pil_image:
160                 pil_image.load()
161             return pil_image
162 
163         raise TypeError(f"Unknown conversion format for Image: {format}")
164
```
--- 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/core/src/toga/images.py b/core/src/toga/images.py
--- a/core/src/toga/images.py
+++ b/core/src/toga/images.py
@@ -36,13 +36,16 @@
     ImageContent: TypeAlias = PathLike | BytesLike | ImageLike
 
 
+NOT_PROVIDED = object()
+
+
 class Image:
     def __init__(
         self,
-        src: ImageContent | None = None,
+        src: ImageContent = NOT_PROVIDED,
         *,
-        path=None,  # DEPRECATED
-        data=None,  # DEPRECATED
+        path=NOT_PROVIDED,  # DEPRECATED
+        data=NOT_PROVIDED,  # DEPRECATED
     ):
         """Create a new image.
 
@@ -56,21 +59,21 @@
         ######################################################################
         # 2023-11: Backwards compatibility
         ######################################################################
-        num_provided = sum(arg is not None for arg in (src, path, data))
+        num_provided = sum(arg is not NOT_PROVIDED for arg in (src, path, data))
         if num_provided > 1:
             raise ValueError("Received multiple arguments to constructor.")
         if num_provided == 0:
             raise TypeError(
                 "Image.__init__() missing 1 required positional argument: 'src'"
             )
-        if path is not None:
+        if path is not NOT_PROVIDED:
             src = path
             warn(
                 "Path argument is deprecated, use src instead.",
                 DeprecationWarning,
                 stacklevel=2,
             )
-        elif data is not None:
+        elif data is not NOT_PROVIDED:
             src = data
             warn(
                 "Data argument is deprecated, use src instead.",

{"golden_diff": "diff --git a/core/src/toga/images.py b/core/src/toga/images.py\n--- a/core/src/toga/images.py\n+++ b/core/src/toga/images.py\n@@ -36,13 +36,16 @@\n     ImageContent: TypeAlias = PathLike | BytesLike | ImageLike\n \n \n+NOT_PROVIDED = object()\n+\n+\n class Image:\n     def __init__(\n         self,\n-        src: ImageContent | None = None,\n+        src: ImageContent = NOT_PROVIDED,\n         *,\n-        path=None,  # DEPRECATED\n-        data=None,  # DEPRECATED\n+        path=NOT_PROVIDED,  # DEPRECATED\n+        data=NOT_PROVIDED,  # DEPRECATED\n     ):\n         \"\"\"Create a new image.\n \n@@ -56,21 +59,21 @@\n         ######################################################################\n         # 2023-11: Backwards compatibility\n         ######################################################################\n-        num_provided = sum(arg is not None for arg in (src, path, data))\n+        num_provided = sum(arg is not NOT_PROVIDED for arg in (src, path, data))\n         if num_provided > 1:\n             raise ValueError(\"Received multiple arguments to constructor.\")\n         if num_provided == 0:\n             raise TypeError(\n                 \"Image.__init__() missing 1 required positional argument: 'src'\"\n             )\n-        if path is not None:\n+        if path is not NOT_PROVIDED:\n             src = path\n             warn(\n                 \"Path argument is deprecated, use src instead.\",\n                 DeprecationWarning,\n                 stacklevel=2,\n             )\n-        elif data is not None:\n+        elif data is not NOT_PROVIDED:\n             src = data\n             warn(\n                 \"Data argument is deprecated, use src instead.\",\n", "issue": "`toga.Image()` doesn't accept `None` as a value for `src`\n### Describe the bug\n\n`toga.Image()` doesn't accept `None` as a value for `src`, but according to the docs and code: https://github.com/beeware/toga/blob/61dff563d82da71bd2470cde27882731113eda2d/core/src/toga/images.py#L42C9-L42C41 it should accept `None` as a value.\n\n### Steps to reproduce\n\n1. Clone latest toga/main branch\r\n2. `pip install -e ./core -e ./dummy -e ./gtk`\r\n3. Create a new briefcase project\r\n4. Use the following `app.py` script:\r\n```\r\n\"\"\"\r\nMy first application\r\n\"\"\"\r\nimport toga\r\nfrom toga.style import Pack\r\nfrom toga.style.pack import COLUMN, ROW\r\n\r\n\r\nclass HelloWorld(toga.App):\r\n\r\n    def startup(self):\r\n        \"\"\"\r\n        Construct and show the Toga application.\r\n\r\n        Usually, you would add your application to a main content box.\r\n        We then create a main window (with a name matching the app), and\r\n        show the main window.\r\n        \"\"\"\r\n        main_box = toga.Box()\r\n        img = toga.Image(src=None)\r\n        self.main_window = toga.MainWindow(title=self.formal_name)\r\n        self.main_window.content = main_box\r\n        self.main_window.show()\r\n\r\n\r\ndef main():\r\n    return HelloWorld()\r\n```\r\n\r\n5. `briefcase dev`\r\n6. Error encountered:\r\n```\r\n\r\n[helloworld] Starting in dev mode...\r\n===========================================================================\r\nTraceback (most recent call last):\r\n  File \"/home/proneon267/Pictures/venv/lib/python3.11/site-packages/toga_gtk/app.py\", line 87, in gtk_startup\r\n    self.interface._startup()\r\n  File \"/home/proneon267/Pictures/venv/lib/python3.11/site-packages/toga/app.py\", line 629, in _startup\r\n    self.startup()\r\n  File \"/home/proneon267/Pictures/toga/helloworld/src/helloworld/app.py\", line 20, in startup\r\n    img = toga.Image(src=None)\r\n          ^^^^^^^^^^^^^^^^^^^^\r\n  File \"/home/proneon267/Pictures/venv/lib/python3.11/site-packages/toga/images.py\", line 63, in __init__\r\n    raise TypeError(\r\nTypeError: Image.__init__() missing 1 required positional argument: 'src'\r\n```\r\n\n\n### Expected behavior\n\n`toga.Image()` should accept `None` as a value for `src`\n\n### Screenshots\n\n_No response_\n\n### Environment\n\n- Operating System: Arch\r\n- Python version: 3.11.6\r\n- Software versions:\r\n  - Briefcase: 0.3.16\r\n  - Toga: latest\r\n  - ...\r\n\n\n### Logs\n\n```\r\nNo log files were generated.\r\n```\r\n\n\n### Additional context\n\n_No response_\n", "before_files": [{"content": "from __future__ import annotations\n\nimport sys\nimport warnings\nfrom io import BytesIO\nfrom pathlib import Path\nfrom typing import TYPE_CHECKING, Any\nfrom warnings import warn\n\ntry:\n    import PIL.Image\n\n    PIL_imported = True\nexcept ImportError:  # pragma: no cover\n    PIL_imported = False\n\nimport toga\nfrom toga.platform import get_platform_factory\n\n# Make sure deprecation warnings are shown by default\nwarnings.filterwarnings(\"default\", category=DeprecationWarning)\n\nif TYPE_CHECKING:\n    if sys.version_info < (3, 10):\n        from typing_extensions import TypeAlias, TypeVar\n    else:\n        from typing import TypeAlias, TypeVar\n\n    # Define a type variable for generics where an Image type is required.\n    ImageT = TypeVar(\"ImageT\")\n\n    # Define the types that can be used as Image content\n    PathLike: TypeAlias = str | Path\n    BytesLike: TypeAlias = bytes | bytearray | memoryview\n    ImageLike: TypeAlias = Any\n    ImageContent: TypeAlias = PathLike | BytesLike | ImageLike\n\n\nclass Image:\n    def __init__(\n        self,\n        src: ImageContent | None = None,\n        *,\n        path=None,  # DEPRECATED\n        data=None,  # DEPRECATED\n    ):\n        \"\"\"Create a new image.\n\n        :param src: The source from which to load the image. Can be any valid\n            :any:`image content <ImageContent>` type.\n        :param path: **DEPRECATED** - Use ``src``.\n        :param data: **DEPRECATED** - Use ``src``.\n        :raises FileNotFoundError: If a path is provided, but that path does not exist.\n        :raises ValueError: If the source cannot be loaded as an image.\n        \"\"\"\n        ######################################################################\n        # 2023-11: Backwards compatibility\n        ######################################################################\n        num_provided = sum(arg is not None for arg in (src, path, data))\n        if num_provided > 1:\n            raise ValueError(\"Received multiple arguments to constructor.\")\n        if num_provided == 0:\n            raise TypeError(\n                \"Image.__init__() missing 1 required positional argument: 'src'\"\n            )\n        if path is not None:\n            src = path\n            warn(\n                \"Path argument is deprecated, use src instead.\",\n                DeprecationWarning,\n                stacklevel=2,\n            )\n        elif data is not None:\n            src = data\n            warn(\n                \"Data argument is deprecated, use src instead.\",\n                DeprecationWarning,\n                stacklevel=2,\n            )\n        ######################################################################\n        # End backwards compatibility\n        ######################################################################\n\n        self.factory = get_platform_factory()\n        self._path = None\n\n        # Any \"lump of bytes\" should be valid here.\n        if isinstance(src, (bytes, bytearray, memoryview)):\n            self._impl = self.factory.Image(interface=self, data=src)\n\n        elif isinstance(src, (str, Path)):\n            self._path = toga.App.app.paths.app / src\n            if not self._path.is_file():\n                raise FileNotFoundError(f\"Image file {self._path} does not exist\")\n            self._impl = self.factory.Image(interface=self, path=self._path)\n\n        elif isinstance(src, Image):\n            self._impl = self.factory.Image(interface=self, data=src.data)\n\n        elif PIL_imported and isinstance(src, PIL.Image.Image):\n            buffer = BytesIO()\n            src.save(buffer, format=\"png\", compress_level=0)\n            self._impl = self.factory.Image(interface=self, data=buffer.getvalue())\n\n        elif isinstance(src, self.factory.Image.RAW_TYPE):\n            self._impl = self.factory.Image(interface=self, raw=src)\n\n        else:\n            raise TypeError(\"Unsupported source type for Image\")\n\n    @property\n    def size(self) -> (int, int):\n        \"\"\"The size of the image, as a (width, height) tuple.\"\"\"\n        return (self._impl.get_width(), self._impl.get_height())\n\n    @property\n    def width(self) -> int:\n        \"\"\"The width of the image, in pixels.\"\"\"\n        return self._impl.get_width()\n\n    @property\n    def height(self) -> int:\n        \"\"\"The height of the image, in pixels.\"\"\"\n        return self._impl.get_height()\n\n    @property\n    def data(self) -> bytes:\n        \"\"\"The raw data for the image, in PNG format.\"\"\"\n        return self._impl.get_data()\n\n    @property\n    def path(self) -> Path | None:\n        \"\"\"The path from which the image was opened, if any (or None).\"\"\"\n        return self._path\n\n    def save(self, path: str | Path) -> None:\n        \"\"\"Save image to given path.\n\n        The file format of the saved image will be determined by the extension of\n        the filename provided (e.g ``path/to/mypicture.png`` will save a PNG file).\n\n        :param path: Path to save the image to.\n        \"\"\"\n        self._impl.save(path)\n\n    def as_format(self, format: type[ImageT]) -> ImageT:\n        \"\"\"Return the image, converted to the image format specified.\n\n        :param format: The image class to return. Currently supports only :any:`Image`,\n            and :any:`PIL.Image.Image` if Pillow is installed.\n        :returns: The image in the requested format\n        :raises TypeError: If the format supplied is not recognized.\n        \"\"\"\n        if isinstance(format, type) and issubclass(format, Image):\n            return format(self.data)\n\n        if PIL_imported and format is PIL.Image.Image:\n            buffer = BytesIO(self.data)\n            with PIL.Image.open(buffer) as pil_image:\n                pil_image.load()\n            return pil_image\n\n        raise TypeError(f\"Unknown conversion format for Image: {format}\")\n", "path": "core/src/toga/images.py"}], "after_files": [{"content": "from __future__ import annotations\n\nimport sys\nimport warnings\nfrom io import BytesIO\nfrom pathlib import Path\nfrom typing import TYPE_CHECKING, Any\nfrom warnings import warn\n\ntry:\n    import PIL.Image\n\n    PIL_imported = True\nexcept ImportError:  # pragma: no cover\n    PIL_imported = False\n\nimport toga\nfrom toga.platform import get_platform_factory\n\n# Make sure deprecation warnings are shown by default\nwarnings.filterwarnings(\"default\", category=DeprecationWarning)\n\nif TYPE_CHECKING:\n    if sys.version_info < (3, 10):\n        from typing_extensions import TypeAlias, TypeVar\n    else:\n        from typing import TypeAlias, TypeVar\n\n    # Define a type variable for generics where an Image type is required.\n    ImageT = TypeVar(\"ImageT\")\n\n    # Define the types that can be used as Image content\n    PathLike: TypeAlias = str | Path\n    BytesLike: TypeAlias = bytes | bytearray | memoryview\n    ImageLike: TypeAlias = Any\n    ImageContent: TypeAlias = PathLike | BytesLike | ImageLike\n\n\nNOT_PROVIDED = object()\n\n\nclass Image:\n    def __init__(\n        self,\n        src: ImageContent = NOT_PROVIDED,\n        *,\n        path=NOT_PROVIDED,  # DEPRECATED\n        data=NOT_PROVIDED,  # DEPRECATED\n    ):\n        \"\"\"Create a new image.\n\n        :param src: The source from which to load the image. Can be any valid\n            :any:`image content <ImageContent>` type.\n        :param path: **DEPRECATED** - Use ``src``.\n        :param data: **DEPRECATED** - Use ``src``.\n        :raises FileNotFoundError: If a path is provided, but that path does not exist.\n        :raises ValueError: If the source cannot be loaded as an image.\n        \"\"\"\n        ######################################################################\n        # 2023-11: Backwards compatibility\n        ######################################################################\n        num_provided = sum(arg is not NOT_PROVIDED for arg in (src, path, data))\n        if num_provided > 1:\n            raise ValueError(\"Received multiple arguments to constructor.\")\n        if num_provided == 0:\n            raise TypeError(\n                \"Image.__init__() missing 1 required positional argument: 'src'\"\n            )\n        if path is not NOT_PROVIDED:\n            src = path\n            warn(\n                \"Path argument is deprecated, use src instead.\",\n                DeprecationWarning,\n                stacklevel=2,\n            )\n        elif data is not NOT_PROVIDED:\n            src = data\n            warn(\n                \"Data argument is deprecated, use src instead.\",\n                DeprecationWarning,\n                stacklevel=2,\n            )\n        ######################################################################\n        # End backwards compatibility\n        ######################################################################\n\n        self.factory = get_platform_factory()\n        self._path = None\n\n        # Any \"lump of bytes\" should be valid here.\n        if isinstance(src, (bytes, bytearray, memoryview)):\n            self._impl = self.factory.Image(interface=self, data=src)\n\n        elif isinstance(src, (str, Path)):\n            self._path = toga.App.app.paths.app / src\n            if not self._path.is_file():\n                raise FileNotFoundError(f\"Image file {self._path} does not exist\")\n            self._impl = self.factory.Image(interface=self, path=self._path)\n\n        elif isinstance(src, Image):\n            self._impl = self.factory.Image(interface=self, data=src.data)\n\n        elif PIL_imported and isinstance(src, PIL.Image.Image):\n            buffer = BytesIO()\n            src.save(buffer, format=\"png\", compress_level=0)\n            self._impl = self.factory.Image(interface=self, data=buffer.getvalue())\n\n        elif isinstance(src, self.factory.Image.RAW_TYPE):\n            self._impl = self.factory.Image(interface=self, raw=src)\n\n        else:\n            raise TypeError(\"Unsupported source type for Image\")\n\n    @property\n    def size(self) -> (int, int):\n        \"\"\"The size of the image, as a (width, height) tuple.\"\"\"\n        return (self._impl.get_width(), self._impl.get_height())\n\n    @property\n    def width(self) -> int:\n        \"\"\"The width of the image, in pixels.\"\"\"\n        return self._impl.get_width()\n\n    @property\n    def height(self) -> int:\n        \"\"\"The height of the image, in pixels.\"\"\"\n        return self._impl.get_height()\n\n    @property\n    def data(self) -> bytes:\n        \"\"\"The raw data for the image, in PNG format.\"\"\"\n        return self._impl.get_data()\n\n    @property\n    def path(self) -> Path | None:\n        \"\"\"The path from which the image was opened, if any (or None).\"\"\"\n        return self._path\n\n    def save(self, path: str | Path) -> None:\n        \"\"\"Save image to given path.\n\n        The file format of the saved image will be determined by the extension of\n        the filename provided (e.g ``path/to/mypicture.png`` will save a PNG file).\n\n        :param path: Path to save the image to.\n        \"\"\"\n        self._impl.save(path)\n\n    def as_format(self, format: type[ImageT]) -> ImageT:\n        \"\"\"Return the image, converted to the image format specified.\n\n        :param format: The image class to return. Currently supports only :any:`Image`,\n            and :any:`PIL.Image.Image` if Pillow is installed.\n        :returns: The image in the requested format\n        :raises TypeError: If the format supplied is not recognized.\n        \"\"\"\n        if isinstance(format, type) and issubclass(format, Image):\n            return format(self.data)\n\n        if PIL_imported and format is PIL.Image.Image:\n            buffer = BytesIO(self.data)\n            with PIL.Image.open(buffer) as pil_image:\n                pil_image.load()\n            return pil_image\n\n        raise TypeError(f\"Unknown conversion format for Image: {format}\")\n", "path": "core/src/toga/images.py"}]}