Read transparency from PNG image lazarus / 39-Graphics ---------------------------------------------------------------------- artem101 · 2022-02-23 09:25 How to get transparency value for each pixel from TPortableNetworkGraphic object? ---------------------------------------------------------------------- Handoko · 2022-02-23 09:35 Maybe you can try this color tester, in the link below goto Graphics category then click the Get pixel color of an image: https://wiki.freepascal.org/Portal:HowTo_Demos ---------------------------------------------------------------------- flowCRANE · 2022-02-24 23:25 It is easy — just use the TPortableNetworkGraphic.ScanLine property to get pointer to the each image row. And then, iterate through all pixels in the given row, treating the row pointer as an array of 4-byte structures (in BGRA format). For my own purposes, I'm using something like this: Code: Pascal  [Select][+][-]window.onload = function(){var x1 = document.getElementById("main_content_section"); if (x1) { var x = document.getElementsByClassName("geshi");for (var i = 0; i procedure DoSomething(AImage: TPortableNetworkGraphic);type  PPNGLine = ^TPNGLine;  TPNGLine = packed array [UInt16] of packed record B, G, R, A: UInt8; end;var  Line: PPNGLine;  LineIndex, PixelIndex: Integer;begin  AImage.BeginUpdate();  try    for LineIndex := 0 to AImage.Height - 1 do    begin      Line := AImage.ScanLine[LineIndex];       for PixelIndex := 0 to AImage.Width - 1 do        // alpha channel of the current pixel is in the "Line^[PixelIndex].A" field, for reading and writing    end;  finally    AImage.EndUpdate();  end;end; You can use this template for 24-bit and 32-bit images, also for bitmaps and other formats.