tensorflow::
ops::
EncodeJpeg
#include <image_ops.h>
JPEG-encode an image.
Summary
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
:
Args:
- scope: A Scope object
-
image: 3-D with shape
[height, width, channels]
.
Optional attributes (see
Attrs
):
- format: Per pixel image format.
- quality: Quality of the compression from 0 to 100 (higher is better and slower).
- progressive: If True, create a JPEG that loads progressively (coarse to fine).
- optimize_size: If True, spend CPU/RAM to reduce size with no quality change.
- chroma_downsampling: See http://en.wikipedia.org/wiki/Chroma_subsampling .
-
density_unit: Unit used to specify
x_density
andy_density
: pixels per inch ('in'
) or centimeter ('cm'
). - x_density: Horizontal pixels per density unit.
- y_density: Vertical pixels per density unit.
- xmp_metadata: If not empty, embed this XMP metadata in the image header.
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
|
|
operation
|
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::
|
Optional attribute setters for EncodeJpeg . |
Public attributes
Public functions
EncodeJpeg
EncodeJpeg( const ::tensorflow::Scope & scope, ::tensorflow::Input image, const EncodeJpeg::Attrs & attrs )
node
::tensorflow::Node * node() const
operator::tensorflow::Input
operator::tensorflow::Input() const
operator::tensorflow::Output
operator::tensorflow::Output() const