#include <image_ops.h>
JPEG-encode an image.
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. The
channelsdimension of
imagemust be 1. *
rgb: Output an RGB JPEG image. The
channelsdimension of
image` 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
:
Arguments:
[height, width, channels]
.Optional attributes (see Attrs
):
x_density
and y_density
: pixels per inch ('in'
) or centimeter ('cm'
).Returns:
Output
: 0-D. JPEG-encoded image. Constructors and Destructors | |
---|---|
EncodeJpeg(const ::tensorflow::Scope & scope, ::tensorflow::Input image) | |
EncodeJpeg(const ::tensorflow::Scope & scope, ::tensorflow::Input image, const EncodeJpeg::Attrs & attrs) |
Public attributes | |
---|---|
contents |
Public functions | |
---|---|
node() const | ::tensorflow::Node * |
operator::tensorflow::Input() const | |
operator::tensorflow::Output() const |
Public static functions | |
---|---|
ChromaDownsampling(bool x) | |
DensityUnit(StringPiece x) | |
Format(StringPiece x) | |
OptimizeSize(bool x) | |
Progressive(bool x) | |
Quality(int64 x) | |
XDensity(int64 x) | |
XmpMetadata(StringPiece x) | |
YDensity(int64 x) |
Structs | |
---|---|
tensorflow::ops::EncodeJpeg::Attrs | Optional attribute setters for EncodeJpeg. |
::tensorflow::Output contents
EncodeJpeg( const ::tensorflow::Scope & scope, ::tensorflow::Input image )
EncodeJpeg( const ::tensorflow::Scope & scope, ::tensorflow::Input image, const EncodeJpeg::Attrs & attrs )
::tensorflow::Node * node() const
operator::tensorflow::Input() const
operator::tensorflow::Output() const
Attrs ChromaDownsampling( bool x )
Attrs DensityUnit( StringPiece x )
Attrs Format( StringPiece x )
Attrs OptimizeSize( bool x )
Attrs Progressive( bool x )
Attrs Quality( int64 x )
Attrs XDensity( int64 x )
Attrs XmpMetadata( StringPiece x )
Attrs YDensity( int64 x )
© 2017 The TensorFlow Authors. All rights reserved.
Licensed under the Creative Commons Attribution License 3.0.
Code samples licensed under the Apache 2.0 License.
https://www.tensorflow.org/api_docs/cc/class/tensorflow/ops/encode-jpeg.html