Windows: Jscript convert result not same as cmd convert
Posted: 2011-06-26T11:24:58-07:00
Using Windows Vista business. IM-6.7.0-Q16. Javascript and ActiveX. Tested code from "http://hoernle1.de/m/imagick6/masking/index.html", concerning masking for conversion of JPEG to PNG. The code used ran perfectly when using CMD, giving clear transparency. When run with script, converted to transparency, but showed background. Both versions were viewed with "Windows PHOTO Gallery" program, which revealed the difference.
CMD code: im1 -bordercolor white -border 1x1 -alpha set -channel RGBA -fuzz 1% -fill none -floodfill +0+0 white -shave 1x1 im2
Javascript:
imo = new ActiveXObject("ImageMagickObject.MagickImage.1");
Cmd=[" -bordercolor white"," -border 1x1"," -alpha set"," -channel RGBA"," -fuzz 1%"," -fill none"," -floodfill +0+0 none"," -shave 1x1"];
function TransIm(im1,im2,a){
imo.convert(im1,a[0],a[1],a[2],a[3],a[4],a[5],a[6],a[7],im2);
}
Is there a way to ensure that the script produces the same result as CMD? Thanks in advance!
CMD code: im1 -bordercolor white -border 1x1 -alpha set -channel RGBA -fuzz 1% -fill none -floodfill +0+0 white -shave 1x1 im2
Javascript:
imo = new ActiveXObject("ImageMagickObject.MagickImage.1");
Cmd=[" -bordercolor white"," -border 1x1"," -alpha set"," -channel RGBA"," -fuzz 1%"," -fill none"," -floodfill +0+0 none"," -shave 1x1"];
function TransIm(im1,im2,a){
imo.convert(im1,a[0],a[1],a[2],a[3],a[4],a[5],a[6],a[7],im2);
}
Is there a way to ensure that the script produces the same result as CMD? Thanks in advance!