# cropBuffer

**Kind:** Function

**Source:** [`atloria-monorepo/apps/screenshot-worker/src/app/screenshot/services/crop.service.ts`](https://github.com/sherkety/atloria/blob/main/atloria-monorepo/apps/screenshot-worker/src/app/screenshot/services/crop.service.ts#L111)

Extract a pixel region from an encoded image buffer using sharp.
Returns the cropped image as a new buffer (original untouched).

## Signature

```ts
async function cropBuffer(buffer: Buffer, clip: ClipRect): Promise<Buffer>
```

## Parameters

| Name | Type |
|---|---|
| `buffer` | `Buffer` |
| `clip` | `ClipRect` |

**Returns:** `Promise<Buffer>`
