Yes, the documentation list 'TransparentColor' as a parameter but only for GIF images. GIF is a very limited format, completely outdated, you shouldn't be using it.
As far as I remember, TIF supports transparency (as an alpha channel) but matlab's imwrite doesn't support it for tiff. You may be able to work around it by using the Tiff class. On the other hand, if you're not restricted to TIF, you could write the image as PNG, in my opinion a better format anyway. With PNG, you can designate a single colour as transparent (with the 'Transparency' parameter) or any amount of transparency for each pixel individually (with the 'Alpha' parameter). E.g
imwrite(img, 'somename.png', 'Transparency', [0 0 0]);
alpha = 1 - 0.75 * all(img == 0, 3);
imwrite(img, 'somename.png', 'Alpha', alpha);
Best Answer