Remove selection from PNG Image: How to using Lazarus? lazarus / 39-Graphics ---------------------------------------------------------------------- Boleeman · 2024-12-22 06:09 Hi All. I came across an interesting CSharp program that removes a user selection from an image. Was wondering if anyone has made something similar using Lazarus? Lazpaint probably does this, but I wanted to make a simple Lazarus program to do this. Would probably need to use a TGbrabmp, as a transparent background is needed. The program uses a freestyle type selection by mouse dragging the selected region. Then there are 2 images presented: one with the selection on a transparent background and one with the removed bit. Both of these can then be saved. I also wanted to vary the selection style with say 1. Freestyle selection 2. Straight line selection. 3. Rectangular selection 4. Polygon Selection. 5. Coloured Line Selection I also wanted to add another feature to make selected parts transparent by mouse clicking a selected colour in part of an image. I may try to convert that CSharp program if this has not been done before. Anyhow, I thought I would ask if anything like this exists? ---------------------------------------------------------------------- lainz · 2024-12-22 06:47 Check the bgrabitmap tutorial about using masks. Basically you draw a Black and white image and mask the other bitmap with that... ---------------------------------------------------------------------- Boleeman · 2024-12-22 07:18 Ok. I Lainz I looked at the Tute at https://wiki.freepascal.org/BGRABitmap_tutorial_5 So perhaps use TBGRABitmap: Put a slightly transparent black image ontop of the loaded orginal and use various shaped selections to choose the visible parts ? Hmm, will need to investigate that ! ---------------------------------------------------------------------- lainz · 2024-12-22 07:26 Black is transparent and white is opaque. ---------------------------------------------------------------------- Boleeman · 2024-12-22 07:48 I made a basic test of masking. It seems to work but now need to extend this. Yes, Black is transparent and white is opaque. I get that. But I wanted to overlay a partly transparent Black image on top of the other original one, sort of like Onion Skinning in an animation program, so that I can select only certain regions of the original png image. ---------------------------------------------------------------------- lainz · 2024-12-22 10:16 Check the same tutorial the part about layers