jimp-dev / jimp

An image processing library written entirely in JavaScript for Node, with zero external or native dependencies.
http://jimp-dev.github.io/jimp/
MIT License
14.04k stars 761 forks source link

.color method is slow #1207

Open daniellwdb opened 1 year ago

daniellwdb commented 1 year ago

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

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

hipstersmoothie commented 1 year ago

Find a way to make it fast and I'll merge it

adduss commented 9 months ago

when you plan to merge it @hipstersmoothie ?

hipstersmoothie commented 7 months ago

no pr was every made so there is nothing to merge