Einfach das Alpha-Byte z.B. beim Speichern abhängig von der Farbe setzen.
Delphi-Quellcode:
var
Transparent: TRGBA;
{...}
for i := 0 to (bmp32.Width * bmp32.Height) - 1 do
begin
Color32ToRGBA(P^ , c.r, c.g, c.b, c.a);
DataBuffer[n] := c.B;
inc(n);
DataBuffer[n] := c.G;
inc(n);
DataBuffer[n] := c.R;
inc(n);
if (c.B = Transparent.B) and (c.g = Transparent.g) and (c.r = Transparent.r) then
DataBuffer[n] := {Wert für 100% Transparent}
else
DataBuffer[n] := {Wert für 0% Transparent};
inc(n);
inc(P);
end;