Interesting! Isn't inverting (blackwhite) a different problem to colorizing as demoed? Do you still get artefacts if you do something like PixelColor := ImgBitmap.Canvas.Pixels[x, y]; // Extract RGB values, skipping fully transparent pixels if (PixelColor and $FF000000) 0 then begin R := 255 - GetRValue(PixelColor); G := 255 - GetGValue(PixelColor); B := 255 - GetBValue(PixelColor); // Set the inverted color back, preserving alpha channel ImgBitmap.Canvas.Pixels[x, y] := RGB(R, G, B) or (PixelColor and $FF000000); end; ? (Btw, have you ever used Graphics32? Not for a minute suggesting that using that library would be better here, but it does all kinds of compositing with opacity and is very fast.)
thanks
Is the spelling mistake the missing "u" from "Re-Colouring"?
Interesting! Isn't inverting (blackwhite) a different problem to colorizing as demoed? Do you still get artefacts if you do something like
PixelColor := ImgBitmap.Canvas.Pixels[x, y];
// Extract RGB values, skipping fully transparent pixels
if (PixelColor and $FF000000) 0 then begin
R := 255 - GetRValue(PixelColor); G := 255 - GetGValue(PixelColor); B := 255 - GetBValue(PixelColor);
// Set the inverted color back, preserving alpha channel
ImgBitmap.Canvas.Pixels[x, y] := RGB(R, G, B) or (PixelColor and $FF000000);
end;
?
(Btw, have you ever used Graphics32? Not for a minute suggesting that using that library would be better here, but it does all kinds of compositing with opacity and is very fast.)