Justin Lok
Justin Lok

Reputation: 1270

Convert transparent to white in GraphicsMagick Nodejs

Using gm with nodejs, if I convert a png with transparent pixels to jpg, the transparent pixels are automatically converted to black. How do I change this to convert the transparent pixels to white instead?

gm(image)
.quality(100)
.trim()
.setFormat("jpg")
.interlace("Line")
.resize(650, null)
.noProfile()

Upvotes: 2

Views: 1515

Answers (1)

Justin Lok
Justin Lok

Reputation: 1270

The solution is to add .flatten()

Upvotes: 5

Related Questions