child-process-promise icon indicating copy to clipboard operation
child-process-promise copied to clipboard

Problem with "dither:diffusion-amount=20%" in spawn

Open v11 opened this issue 5 years ago • 0 comments

Hello

I am building a small webapp with Firebase to provide e-paper-ready images. To convert images to bitmap i am using a cloud function (node.js) and the Imagemagick Library.

I have the following string in a Node.js Firebase Cloud Function: await spawn('convert', [tempFilePath, '-resize', displaySize + '^', '-gravity', 'center', '-extent', displaySize, dither, ditherValue, '-define', 'dither:diffusion-amount=20%', '-remap', tempFilePath_Map, '-type', 'Palette', 'BMP3:' + tempFilePathBitmap]); Which should be equal to this: convert image.pngl -resize 600x448^ -gravity center -extent 600x448 -dither FloydSteinberg -define dither:diffusion-amount=20% -remap eink-7color.png -type Palette, BMP3:images.bmp

It works very well. But: The following option has no effect: dither:diffusion-amount=20%

Has it something to do with the %-sign? Do i need to escape it correctly? I think Google is is running ImageMagick 7.0.10-48. And other guys confirmed that this command should work with this version.

[https://github.com/ImageMagick/ImageMagick/discussions/3023]

Any help is very welcome.

Lukas

v11 avatar Dec 23 '20 12:12 v11