Stay organized with collections
Save and categorize content based on your preferences.
tensorflow::ops::EncodePng
#include <image_ops.h>
PNG-encode an image.
Summary
image
is a 3-D uint8 or uint16 Tensor of shape [height, width, channels]
where channels
is:
- 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.
Args:
- scope: A Scope object
- image: 3-D with shape
[height, width, channels]
.
Optional attributes (see Attrs
):
- compression: Compression level.
Returns:
Output
: 0-D. PNG-encoded image.
Public attributes
Public functions
node
::tensorflow::Node * node() const
operator::tensorflow::Input() const
operator::tensorflow::Output
operator::tensorflow::Output() const
Public static functions
Compression
Attrs Compression(
int64 x
)
Except as otherwise noted, the content of this page is licensed under the Creative Commons Attribution 4.0 License, and code samples are licensed under the Apache 2.0 License. For details, see the Google Developers Site Policies. Java is a registered trademark of Oracle and/or its affiliates. Some content is licensed under the numpy license.
Last updated 2023-10-06 UTC.
[null,null,["Last updated 2023-10-06 UTC."],[],[],null,["# tensorflow::ops::EncodePng Class Reference\n\ntensorflow::ops::EncodePng\n==========================\n\n`#include \u003cimage_ops.h\u003e`\n\nPNG-encode an image.\n\nSummary\n-------\n\n`image` is a 3-D uint8 or uint16 [Tensor](/versions/r2.14/api_docs/cc/class/tensorflow/tensor#classtensorflow_1_1_tensor) of shape `[height, width, channels]` where `channels` is:\n\n\n- 1: for grayscale.\n- 2: for grayscale + alpha.\n- 3: for RGB.\n- 4: for RGBA.\n\n\u003cbr /\u003e\n\nThe 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.\n\nArgs:\n\n- scope: A [Scope](/versions/r2.14/api_docs/cc/class/tensorflow/scope#classtensorflow_1_1_scope) object\n- image: 3-D with shape `[height, width, channels]`.\n\n\u003cbr /\u003e\n\nOptional attributes (see [Attrs](/versions/r2.14/api_docs/cc/struct/tensorflow/ops/encode-png/attrs#structtensorflow_1_1ops_1_1_encode_png_1_1_attrs)):\n\n- compression: Compression level.\n\n\u003cbr /\u003e\n\nReturns:\n\n- [Output](/versions/r2.14/api_docs/cc/class/tensorflow/output#classtensorflow_1_1_output): 0-D. PNG-encoded image.\n\n\u003cbr /\u003e\n\n| ### Constructors and Destructors ||\n|---|---|\n| [EncodePng](#classtensorflow_1_1ops_1_1_encode_png_1a1dd56a89fbfdf0a35eb444d4342b2c7a)`(const ::`[tensorflow::Scope](/versions/r2.14/api_docs/cc/class/tensorflow/scope#classtensorflow_1_1_scope)` & scope, ::`[tensorflow::Input](/versions/r2.14/api_docs/cc/class/tensorflow/input#classtensorflow_1_1_input)` image)` ||\n| [EncodePng](#classtensorflow_1_1ops_1_1_encode_png_1a3f8275d8de85c565db8baef06d518dfa)`(const ::`[tensorflow::Scope](/versions/r2.14/api_docs/cc/class/tensorflow/scope#classtensorflow_1_1_scope)` & scope, ::`[tensorflow::Input](/versions/r2.14/api_docs/cc/class/tensorflow/input#classtensorflow_1_1_input)` image, const `[EncodePng::Attrs](/versions/r2.14/api_docs/cc/struct/tensorflow/ops/encode-png/attrs#structtensorflow_1_1ops_1_1_encode_png_1_1_attrs)` & attrs)` ||\n\n| ### Public attributes ||\n|----------------------------------------------------------------------------------------|----------------------------------------------------------------------------------------------------------|\n| [contents](#classtensorflow_1_1ops_1_1_encode_png_1aac6f3548cb8e0539d4e65ddba93ac4b0) | `::`[tensorflow::Output](/versions/r2.14/api_docs/cc/class/tensorflow/output#classtensorflow_1_1_output) |\n| [operation](#classtensorflow_1_1ops_1_1_encode_png_1a3dd11638d8d7a6caa5c0151f099abff7) | [Operation](/versions/r2.14/api_docs/cc/class/tensorflow/operation#classtensorflow_1_1_operation) |\n\n| ### Public functions ||\n|----------------------------------------------------------------------------------------------------------------------|------------------------|\n| [node](#classtensorflow_1_1ops_1_1_encode_png_1a19512289f1f780298ec73b5fd6f54ce4)`() const ` | `::tensorflow::Node *` |\n| [operator::tensorflow::Input](#classtensorflow_1_1ops_1_1_encode_png_1aece039de4b9b0ff1b8b1462ceae15a1b)`() const ` | |\n| [operator::tensorflow::Output](#classtensorflow_1_1ops_1_1_encode_png_1ac1a34a63520602afd8ee1c203bc2ba30)`() const ` | |\n\n| ### Public static functions ||\n|-----------------------------------------------------------------------------------------------------|------------------------------------------------------------------------------------------------------------------------------|\n| [Compression](#classtensorflow_1_1ops_1_1_encode_png_1ab763cfa8c279c172c2ee539abdad9338)`(int64 x)` | [Attrs](/versions/r2.14/api_docs/cc/struct/tensorflow/ops/encode-png/attrs#structtensorflow_1_1ops_1_1_encode_png_1_1_attrs) |\n\n| ### Structs ||\n|---------------------------------------------------------------------------------------------------------|------------------------------------------------------------------------------------------------------------------------------------------------|\n| [tensorflow::ops::EncodePng::Attrs](/versions/r2.14/api_docs/cc/struct/tensorflow/ops/encode-png/attrs) | Optional attribute setters for [EncodePng](/versions/r2.14/api_docs/cc/class/tensorflow/ops/encode-png#classtensorflow_1_1ops_1_1_encode_png). |\n\nPublic attributes\n-----------------\n\n### contents\n\n```text\n::tensorflow::Output contents\n``` \n\n### operation\n\n```text\nOperation operation\n``` \n\nPublic functions\n----------------\n\n### EncodePng\n\n```gdscript\n EncodePng(\n const ::tensorflow::Scope & scope,\n ::tensorflow::Input image\n)\n``` \n\n### EncodePng\n\n```gdscript\n EncodePng(\n const ::tensorflow::Scope & scope,\n ::tensorflow::Input image,\n const EncodePng::Attrs & attrs\n)\n``` \n\n### node\n\n```gdscript\n::tensorflow::Node * node() const \n``` \n\n### operator::tensorflow::Input\n\n```gdscript\n operator::tensorflow::Input() const \n``` \n\n### operator::tensorflow::Output\n\n```gdscript\n operator::tensorflow::Output() const \n``` \n\nPublic static functions\n-----------------------\n\n### Compression\n\n```text\nAttrs Compression(\n int64 x\n)\n```"]]