MCPcopy Index your code
hub / github.com/tensorflow/tfjs / encodePng

Function encodePng

tfjs-node/src/image.ts:244–251  ·  view source on GitHub ↗
(
    image: Tensor3D, compression = 1)

Source from the content-addressed store, hash-verified

242 * @doc {heading: 'Operations', subheading: 'Images', namespace: 'node'}
243 */
244export async function encodePng(
245 image: Tensor3D, compression = 1): Promise<Uint8Array> {
246 ensureTensorflowBackend();
247
248 const backendEncodeImage = (imageData: Uint8Array) =>
249 nodeBackend().encodePng(imageData, image.shape, compression);
250 return encodeImage(image, backendEncodeImage);
251}
252
253async function encodeImage(
254 image: Tensor3D, backendEncodeImage: (imageData: Uint8Array) => Tensor):

Callers

nothing calls this directly

Calls 2

ensureTensorflowBackendFunction · 0.90
encodeImageFunction · 0.85

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…