PNG FormatΒΆ

read_png(
file_path: str,
) Tuple[Tensor, Literal[8, 9, 10, 11, 12, 13, 14, 15, 16]][source]ΒΆ

Read a PNG file

Parameters:

file_path (str) – Path of the png file to read.

Returns:

Image data [1, 3, H, W] in [0., 1.] and its bitdepth.

Return type:

Tuple[Tensor, Literal[8, 9, 10, 11, 12, 13, 14, 15, 16]]

write_png(data: Tensor, file_path: str) None[source]ΒΆ

Save an image x into a PNG file.

Parameters:
  • x – Image to be saved

  • file_path (str) – Where to save the PNG files

  • data (Tensor)

Return type:

None