node.js - Converting EPS to PNG using graphicsmagic for node does not keep transparency -


i've been trying convert transparent eps file transparent png file using graphicsmagic node (http://aheckmann.github.io/gm/).

it needs behave same way following command (preserving transparency of eps)

convert -colorspace srgb in.eps out.png 

the above command works expected when try in node following code 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 tried forcing type truecoloralpha , setting bit depth no avail.

hopefully van advise on i'm doing wrong or information i'm missing.

for stumbling upon problem well, solved me.

var gm = require('gm').subclass({ imagemagick: true });  gm("in.eps").in("-colorspace").in("srgb").write("out.png", function (err) {   if (!err) {     console.log('done');   } }); 

you need add 2 custom in parameters apply colorspace input eps image.


Comments

Popular posts from this blog

timeout - Handshake_timeout on RabbitMQ using python and pika from remote vm -

gcc - MinGW's ld cannot perform PE operations on non PE output file -

c# - Search and Add Comment with OpenXML for Word -