Link Search Menu Expand Document

EncodePng


tensorflow C++ API

tensorflow::ops::EncodePng

PNG-encode an image.


Summary

imageis a 3-D uint8 or uint16Tensorof shape[height, width, channels]wherechannelsis:

  • 1: for grayscale.
  • 2: for grayscale + alpha.
  • 3: for RGB.
  • 4: for RGBA.

The ZLIB compression level,compression, can be -1 for the PNG-encoder default or a value from 0 to 9. 9 is the highest compression level, generating the smallest output, but is slower.

Arguments:

  • scope: A Scope object
  • image: 3-D with shape [height, width, channels].

Returns:

  • Output: 0-D. JPEG-encoded image.

Optional attributes (seeAttrs):

  • compression: Compression level.

Constructor

  • EncodePng(const ::tensorflow::Scope & scope, ::tensorflow::Input image, const EncodePng::Attrs & attrs) .

Public attributes

  • tensorflow::Output contents.

EncodePng block

Source link : https://github.com/EXPNUNI/enuSpaceTensorflow/blob/master/enuSpaceTensorflow/tf_image_ops.cpp

Argument:

  • Scope scope : A Scope object (A scope is generated automatically each page. A scope is not connected.)
  • image: connect Input node.
  • EncodePng::Attrs attrs : input attrs value. ex) compression_ = -1;

Return:

  • Output contents : Output object of EncodeJpeg class object.

Result:

  • std::vector(Tensor) product_result : Returned object of executed result by calling session.

Using Method