MCPcopy
hub / github.com/jimp-dev/jimp / clone

Method clone

packages/core/src/index.ts:528–533  ·  view source on GitHub ↗

* Clone the image into a new Jimp instance. * @param this * @returns A new Jimp instance * @example * ```ts * import { Jimp } from "jimp"; * * const image = new Jimp({ width: 3, height: 3, color: 0xffffffff }); * * const clone = image.clone(); * ```

(this: S)

Source from the content-addressed store, hash-verified

526 * ```
527 */
528 clone<S extends typeof CustomJimp>(this: S) {
529 return new CustomJimp({
530 ...(this as any).bitmap,
531 data: Buffer.from((this as any).bitmap.data),
532 }) as unknown as S;
533 }
534
535 /**
536 * Returns the offset of a pixel in the bitmap buffer

Callers 9

callbacks.test.tsFile · 0.80
autocrop.test.tsFile · 0.80
index.test.tsFile · 0.80
index.test.tsFile · 0.80
index.test.tsFile · 0.80
index.test.tsFile · 0.80
index.test.tsFile · 0.80
index.test.tsFile · 0.80

Calls

no outgoing calls

Tested by

no test coverage detected