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

Function clone

packages/utils/src/index.ts:4–13  ·  view source on GitHub ↗
(image: I)

Source from the content-addressed store, hash-verified

2import tinyColor from "tinycolor2";
3
4export function clone<I extends JimpClass>(image: I): I {
5 const newBitmap = {
6 width: image.bitmap.width,
7 height: image.bitmap.height,
8 data: Buffer.from(image.bitmap.data),
9 };
10
11 // eslint-disable-next-line @typescript-eslint/no-explicit-any
12 return new (image.constructor as any)(newBitmap);
13}
14
15export function scan<I extends JimpClass>(
16 image: I,

Callers 9

diffFunction · 0.90
getHashMethod · 0.90
fisheyeFunction · 0.90
advancedRotateFunction · 0.90
pixelateFunction · 0.90
convoluteFunction · 0.90
displaceFunction · 0.90
shadowFunction · 0.90
containFunction · 0.90

Calls

no outgoing calls

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…