Before everyone would link Convert all images to jpg I must say I am using solution from this thread already.
I am converting huge amount of static gif files to jpg. However some of them have transparent background and there I am getting black background which is not acceptable.
I was trying to use MakeTransparent()
but I don't get how to use it or it doesn't work.
# first try
$image.MakeTransparent("white")
# second try
$col = "#FFFFFF"
$image.MakeTransparent([System.Drawing.ColorTranslator]::FromHtml($col))
Both run in powershell without errors but both generate black background.
I found also Bitmap.Clear(Color.White)
and Bitmap.SetTransparencyKey(Color.White)
but when I trying run code I receive an error
Method invocation failed because [System.Drawing.Bitmap] does not contain a method named 'Clear'.
Same for SetTransparenctKey
.
Is there any other simple function to make transparent background white?