Image printing#

kornia.image.image_to_string(image, max_width=256)[source]#

Obtain the closest xterm-256 approximation string from an image torch.Tensor.

The torch.Tensor shall be either 0~1 float type or 0~255 long type.

Parameters:
  • image (Tensor) – an RGB image with shape \(3HW\).

  • max_width (int, optional) – maximum width of the input image. Default: 256

Return type:

str

kornia.image.print_image(image, max_width=96)[source]#

Print an image to the terminal.

https://github.com/kornia/data/blob/main/print_image.png?raw=true
Parameters:
  • image (Union[str, Tensor]) – path to a valid image file or a torch.Tensor.

  • max_width (int, optional) – maximum width to print to terminal. Default: 96

Return type:

None

Note

Need to use print_image(…).