jimp-dev / jimp-dev/jimp

.color method is slow

Open
#1,207 3 comments 1 reaction 0 assignees View on GitHub
Dominant language
TypeScript
Stars
14.7k
Forks
777
PR merge metrics
No merged PRs in 30d

Description

# Expected Behavior

I would expect some simple colour manipulation to not take longer than 2 seconds.

# Current Behavior

Currently it takes about 8 seconds.

## Steps to Reproduce

```typescript
console.time("process time");

// Tested with any 1600x900 image
const imageBuffer = await image
.color([
{ apply: "desaturate", params: [90] },
{ apply: "darken", params: [40] },
])
.contrast(0.3)
.getBase64Async(Jimp.AUTO);

console.timeEnd("process time"); // process time: 7.738s
```
```
No options: process time: 228.178ms
Only contrast: process time: 232.918ms
Only desaturate: process time: 4.191s
Only darken: process time: 4.153s
```

## Context

- Jimp Version: 0.22.5
- Operating System: Windows 11 Home, 22H2, 22621.1265, Windows Feature Experience Pack 1000.22638.1000.0
- Node version: 18.12.1

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.