Re-Colouring Bitmaps with Correct Alpha Transparency - Delphi 240

แชร์
ฝัง
  • เผยแพร่เมื่อ 25 ธ.ค. 2024

ความคิดเห็น • 7

  • @cengizbalta6371
    @cengizbalta6371 หลายเดือนก่อน

    thanks

  • @brucemcgee5749
    @brucemcgee5749 หลายเดือนก่อน

    Is the spelling mistake the missing "u" from "Re-Colouring"?

  • @fburton8
    @fburton8 หลายเดือนก่อน +1

    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.)