Machriam / TheCardEditor

MIT License
0 stars 0 forks source link

Feature: Transparent Filter #31

Closed TimKroeger13 closed 5 months ago

TimKroeger13 commented 5 months ago

Case: Black and white drawings should be converged into pictures that can hold transparency. White colours should be set to 100% transparency and Back colours to 0% transparency. All colour values in-between should be scaled linear in this range.

Execution: Back picture: rgb(0,0,0) White picture: rbg(255,255,255)

Transparency = (r+b+g) / 765

Example of a grey pixel: Grey picture: rbg(125,125,125)

Transparency = (r+b+g) / 765 => 0.49

Machriam commented 5 months ago

You want a free form filter. The picture is converted to gray and those intensities are used as alpha values.