@Operator(group="image") public final class EncodeJpeg extends PrimitiveOp implements Operand<String>
`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:
Modifier and Type | Class and Description |
---|---|
static class |
EncodeJpeg.Options
Optional attributes for
EncodeJpeg |
operation
Modifier and Type | Method and Description |
---|---|
Output<String> |
asOutput()
Returns the symbolic handle of a tensor.
|
static EncodeJpeg.Options |
chromaDownsampling(Boolean chromaDownsampling) |
Output<String> |
contents()
0-D.
|
static EncodeJpeg |
create(Scope scope,
Operand<UInt8> image,
EncodeJpeg.Options... options)
Factory method to create a class wrapping a new EncodeJpeg operation.
|
static EncodeJpeg.Options |
densityUnit(String densityUnit) |
static EncodeJpeg.Options |
format(String format) |
static EncodeJpeg.Options |
optimizeSize(Boolean optimizeSize) |
static EncodeJpeg.Options |
progressive(Boolean progressive) |
static EncodeJpeg.Options |
quality(Long quality) |
static EncodeJpeg.Options |
xDensity(Long xDensity) |
static EncodeJpeg.Options |
xmpMetadata(String xmpMetadata) |
static EncodeJpeg.Options |
yDensity(Long yDensity) |
equals, hashCode, op, toString
public static EncodeJpeg create(Scope scope, Operand<UInt8> image, EncodeJpeg.Options... options)
scope
- current scopeimage
- 3-D with shape `[height, width, channels]`.options
- carries optional attributes valuespublic static EncodeJpeg.Options format(String format)
format
- Per pixel image format.public static EncodeJpeg.Options quality(Long quality)
quality
- Quality of the compression from 0 to 100 (higher is better and slower).public static EncodeJpeg.Options progressive(Boolean progressive)
progressive
- If True, create a JPEG that loads progressively (coarse to fine).public static EncodeJpeg.Options optimizeSize(Boolean optimizeSize)
optimizeSize
- If True, spend CPU/RAM to reduce size with no quality change.public static EncodeJpeg.Options chromaDownsampling(Boolean chromaDownsampling)
chromaDownsampling
- See http://en.wikipedia.org/wiki/Chroma_subsampling.public static EncodeJpeg.Options densityUnit(String densityUnit)
densityUnit
- Unit used to specify `x_density` and `y_density`:
pixels per inch (`'in'`) or centimeter (`'cm'`).public static EncodeJpeg.Options xDensity(Long xDensity)
xDensity
- Horizontal pixels per density unit.public static EncodeJpeg.Options yDensity(Long yDensity)
yDensity
- Vertical pixels per density unit.public static EncodeJpeg.Options xmpMetadata(String xmpMetadata)
xmpMetadata
- If not empty, embed this XMP metadata in the image header.public Output<String> asOutput()
Operand
Inputs to TensorFlow operations are outputs of another TensorFlow operation. This method is used to obtain a symbolic handle that represents the computation of the input.
asOutput
in interface Operand<String>
OperationBuilder.addInput(Output)
Copyright © 2022. All rights reserved.