MATLAB: Am I not seeing the transparency in the PNG image in some applications when I set the “Transparency” parameter using IMWRITE

acdseeearthfiguregoogleMATLABpainphotoshoppicpictureproshoptranslucenttransparent

PNG files produced by MATLAB that sets the "Transparency" parameter like so:
imwrite(cdata, 'foo.png', 'png','transparency',[0 0 0]);
The result is that depending on the application, some show the black colored ([0 0 0]) portions of the image as transparent while some do not.

Best Answer

It seems that the "Transparency" parameter of the PNG image is not being picked up by some applications.
As a workaround, use the 'Alpha' parameter of the PNG image instead to set the transparency of particular pixels in the image.
Related Question