* 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)
| 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 |
no outgoing calls
no test coverage detected