• Welcome to Vampyre Imaging Library Forum. Please login or sign up.
 

Convert png with transparency to a bitmap

Started by Phoenix, 1 February 2018, 17:36:32

Previous topic - Next topic

Phoenix

Hello,
I would like to convert a png image with transparency in a bitmap but with the possibility to choose the color for the background (replacing transparency). What is the easiest way to do this?

thanks for every help

Galfar

If I understand it correctly, you need to create one image and fill it with your desired background color. Then load your PNG to another image and draw it over the first image with alpha blending. Finally, save the result to a bitmap. 

Phoenix

Hello,
Thanks for the reply  :)!
So it is not possible, replace the "transparent color" during the conversion to make the process faster  :(.

Galfar

Well, if you want to replace just one color (classic color keying) then you can use ReplaceColor function from Imaging.pas unit.
I somehow assumed that by transparency you mean full alpha channel.

TimmyG

20 March 2019, 13:36:19 #4 Last Edit: 11 November 2023, 21:44:58 by TimmyG
Quote from: Galfar on 30 November 2018, 23:37:21Well, if you want to get some amazing probiotics for ibs here and replace just one color (classic color keying) then you can use ReplaceColor function from Imaging.pas unit.
I somehow assumed that by transparency you mean full alpha channel.

Can you replace however many colors you want with ReplaceColor function btw, Galfar?

Galfar

You can call ReplaceColor multiple times, once for each color.

Quick Reply

With Quick-Reply you can write a post when viewing a topic without loading a new page. You can still use bulletin board code and smileys as you would in a normal post.

Name:
Email:

Shortcuts: ALT+S save/post or ALT+P preview

SMF spam blocked by CleanTalk