![](/img/trans.png)
[英]how to control the distorted and stretched image in graphicsmagick node.js
[英]How to edit the exposure of an HDRI image using GraphicsMagick and Node.js?
我安装了ImageMagick,支持HDRI图像。 使用bash,可以使用以下命令以不同数量的“stop”保存图像(其中stop是曝光度量):
stops=`convert xc: -format "%[fx:pow(2,-1)]"`
convert input.exr \
-colorspace RGB \
-function polynomial "$stops,0" \
-gamma 1 \
-colorspace sRGB \
output-minus-one-stop.jpg
为了做这个Node.js,需要一些翻译:
var stops = Math.pow(2, -1);
gm('input.exr').colorspace('RGB')
.out(`function polynomial "${stops},0"`)
.gamma(1, 1, 1)
.colorspace('sRGB')
.write('output-minus-one-stop.jpg', function(err){});
但是我得到错误:
Command failed: convert: unable to open image `function polynomial "0.25,0"': No such file or directory @ error/blob.c/OpenBlob/2702
convert: no decode delegate for this image format `25,0"' @ error/constitute.c/ReadImage/501
由于这一行,错误正在发生:
.out(`function polynomial "${stops},0"`)
在这个例子中格式化out命令的正确方法是什么?
我不说节点,但我对ImageMagick非常熟悉。
该gm
你看起来(我)像GraphicsMagick工具 ,而不是ImageMagick的 (两者是不同的),我不认为GraphicsMagick工具有-function polynomial
。
你可以转向IM而不是GM吗? 无论如何,我可能都错了 - 如果有人知道的话,我很乐意纠正。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.