The image you posted is not transparent. It has an opaque checkerboard background. However, if it was transparent, this Imagemagick command should work.
convert image.png -background white -flatten -negate result.png
If using Imagemagick 7, then change convert to magick