aheckmann / gm

GraphicsMagick for node
http://aheckmann.github.com/gm/
6.96k stars 617 forks source link

How can I exchange only one color? #838

Closed gmuc closed 3 years ago

gmuc commented 3 years ago

I use the code:

const gm = require('gm');

gm('./in.png').opaque('#ccffff').fill('black').write('./out.png', (err) => {
    console.log("recolored file saved");
});

But it change more than pixel of color '#ccffff'! But I need 1:1 mapping! How can I solve this?

Module replace-color do this correct, but you can use only one color -> bad!

gmuc commented 3 years ago

If I understand this right https://legacy.imagemagick.org/Usage/color_basics/#replace