我需要从PNG转换为JPG。
但是,iMagick 为其添加了黑色背景。
我看到了这个针对 PHP 的问题,并尝试为 java 编写同样的问题,如下所示:
// create the a jpg image
ConvertCmd cmd = new ConvertCmd();
// create the operation, add images and operators/options
IMOperation op = new IMOperation();
op.addImage(brandingURL);
op.format("JPEG");
op.composite();
op.background("white");
op.addImage(imageLocation);
//op.transparent();
// execute the operation
cmd.run(op);
但是,图像仍然带有黑色背景。
我错过了什么?