Repository: kornia/kornia

Issue:
The docs build failing because of image_print
              the doocs build failing is related to this PR
```console
__________________ [doctest] kornia.image.image.Image.print ___________________
284 
285         .. image:: https://github.com/kornia/data/blob/a82d2bdc868f3774a1be91419a2870e54222389e/print_image.png
286 
287         Args:
288             max_width: the maximum width of the image to print.
289 
290         Example:
291             >>> data = np.ones((4, 5, 3), dtype=np.uint8)  # HxWxC
292             >>> img = Image.from_numpy(data)
293             >>> img.print()
UNEXPECTED EXCEPTION: TypeError("Not a color or gray tensor. Got: <class 'torch.Tensor'>.\nNone")
Traceback (most recent call last):
  File "/usr/share/miniconda/envs/test/lib/python3.8/doctest.py", line 1336, in __run
    exec(compile(example.source, filename, "single",
  File "<doctest kornia.image.image.Image.print[2]>", line 1, in <module>
  File "/home/runner/work/kornia/kornia/kornia/image/image.py", line 295, in print
    print(image_to_string(self.data, max_width))
  File "/home/runner/work/kornia/kornia/kornia/utils/image_print.py", line 350, in image_to_string
    KORNIA_CHECK_IS_IMAGE(image, None, raises=True)
  File "/home/runner/work/kornia/kornia/kornia/core/check.py", line 362, in KORNIA_CHECK_IS_IMAGE
    res = KORNIA_CHECK_IS_COLOR_OR_GRAY(x, msg, raises=raises)
  File "/home/runner/work/kornia/kornia/kornia/core/check.py", line 338, in KORNIA_CHECK_IS_COLOR_OR_GRAY
    raise TypeError(f"Not a color or gray tensor. Got: {type(x)}.\n{msg}")
TypeError: Not a color or gray tensor. Got: <class 'torch.Tensor'>.
```

_Originally posted by @johnnv1 in https://github.com/kornia/kornia/issues/2481#issuecomment-1654580164_
            


Discussion:

Resolving patch:
diff --git a/kornia/image/image.py b/kornia/image/image.py
--- a/kornia/image/image.py
+++ b/kornia/image/image.py
@@ -282,14 +282,14 @@ def write(self, file_path: str | Path) -> None:
     def print(self, max_width: int = 256) -> None:
         """Print the image tensor to the console.
 
-        .. image:: https://github.com/kornia/data/blob/a82d2bdc868f3774a1be91419a2870e54222389e/print_image.png
-
         Args:
             max_width: the maximum width of the image to print.
 
-        Example:
-            >>> data = np.ones((4, 5, 3), dtype=np.uint8)  # HxWxC
-            >>> img = Image.from_numpy(data)
-            >>> img.print()
+        .. code-block:: python
+
+            img = Image.from_file("panda.png")
+            img.print()
+
+        .. image:: https://github.com/kornia/data/blob/main/print_image.png?raw=true
         """
         print(image_to_string(self.data, max_width))
diff --git a/kornia/utils/image_print.py b/kornia/utils/image_print.py
--- a/kornia/utils/image_print.py
+++ b/kornia/utils/image_print.py
@@ -372,7 +372,7 @@ def image_to_string(image: Tensor, max_width: int = 256) -> str:
 def print_image(image: Union[str, Tensor], max_width: int = 96) -> None:
     """Print an image to the terminal.
 
-    .. image:: https://github.com/kornia/data/blob/a82d2bdc868f3774a1be91419a2870e54222389e/print_image.png
+    .. image:: https://github.com/kornia/data/blob/main/print_image.png?raw=true
 
     Args:
         image: path to a valid image file or a tensor.


Test patch: