{ }
JPEG-encode an image.
tf.raw_ops.EncodeJpeg(
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:
''
: Use a default format based on the number of channels in the image.grayscale
: Output a grayscale JPEG image. Thechannels
dimension ofimage
must be 1.rgb
: Output an RGB JPEG image. Thechannels
dimension ofimage
must be 3.
If format
is not specified or is the empty string, a default format is picked
in function of the number of channels in image
:
- 1: Output a grayscale image.
- 3: Output an RGB image.
Returns | |
---|---|
A Tensor of type string .
|