I've been trying to convert a transparent EPS file to a transparent PNG file using graphicsmagic for node (http://aheckmann.github.io/gm/).
It needs to behave the same way as the following command (preserving transparency of the EPS)
convert -colorspace srgb in.eps out.png
The above command works as expected but when I try it in node with the following code it does not retain transparency.
var gm = require('gm').subClass({ imageMagick: true });
gm("in.eps").colorspace("srgb").write("out.png", function (err) {
if (!err) {
console.log('done');
}
});
I've also tried forcing the type TrueColorAlpha
and setting the bit depth but to no avail.
Hopefully someone van advise on what I'm doing wrong or which information I'm missing.
For anyone stumbling upon this problem as well, this solved it for me.
You need to add two custom
in
parameters to apply colorspace to the input EPS image.