How to edit the exposure of an HDRI image using GraphicsMagick and Node.js? -
i have imagemagick installed support hdri images. using bash, following command can used save image different number of 'stops' (where stops measure of exposure):
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
in order node.js, translation needed:
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){});
however error:
command failed: convert: unable open image `function polynomial "0.25,0"': no such file or directory @ error/blob.c/openblob/2702 convert: no decode delegate image format `25,0"' @ error/constitute.c/readimage/501
the error happening because of line:
.out(`function polynomial "${stops},0"`)
what's correct way format out command in example?
i don't speak node, familiar imagemagick.
the gm
have looks (to me) graphicsmagick rather imagemagick (the 2 different) , don't think graphicsmagick has -function polynomial
.
can move im rather gm? may wrong on either count - , happy corrected if knows better.
Comments
Post a Comment