I have a TBitmap, inside the TBitmap there is load a "map image" (image of a map). This map image have a white background and a lot of black line (no antialising only 2 colors white background and black line).
Now I must do this:
- Remove the white background from TBitmap (transparent background and black line);
- If possible and only if possible replace black line color with another color;
- Save the result as trasparent PNG image;
I don't have idea if these are possible. Suggestions?
NOTE I want avoid to use 3th part of class or VCL if possible. I can use FreeImage library if need because I just use it on my project. I use Delphi XE3.
Change pixelformat to pf1Bit. Create a palette with 2 entries, change the values of the TPaletteEntry to the desired color value (in the shown exaple to red). Create a TPNGImage, assign the bitmap and set the transparency for the PNG.