tf.io.encode_jpeg

JPEG-encode an image.

tf.io.encode_jpeg(
    image, format='', quality=95, progressive=False, optimize_size=False,
    chroma_downsampling=True, density_unit='in', x_density=300, y_density=300,
    xmp_metadata='', name=None
)

image is a 3-D uint8 Tensor of shape [height, width, channels].

The attr format can be used to override the color format of the encoded output. Values can be:

If format is not specified or is the empty string, a default format is picked in function of the number of channels in image:

Args:

Returns:

A Tensor of type string.