質問

I'm using the im4java library to convert svg files to png files. I want the transparent backgrounds to remain transparent but they always become white. This is the operation I'm using:

IMOperation hdpiOperation = new IMOperation();
hdpiOperation.addImage();
hdpiOperation.background("none");
hdpiOperation.addImage();

If I manually try with ImageMagick from the commandline using this command it does work:

convert -background none a.svg b.png

Any ideas?

役に立ちましたか?

解決

Since im4java appends parameters in method execution order, you can move hdpiOperation.background("none") call before image placeholders to mimic working 'raw' command:

hdpiOperation.background("none");
hdpiOperation.addImage();
hdpiOperation.addImage();
ライセンス: CC-BY-SA帰属
所属していません StackOverflow
scroll top