matmen / ImageScript

zero-dependency JavaScript image manipulation
https://www.npmjs.com/package/imagescript
Other
616 stars 32 forks source link

[FR] Replace (background) color to transparency #39

Open tfrancois opened 2 months ago

tfrancois commented 2 months ago

Is your feature request related to a problem? Please describe.

Is there was a way to add a feature to take a PNG or JPG source image and replace the default background color with a transparent background or alpha/translucency. If necessary, the default background color can simply be selected using the pixel at the [0,0] x/y coordinate of the source image.

simxnet commented 2 months ago

just change the background pixels alpha

tfrancois commented 2 months ago

Thank you for the quick reply. But how do you that? I need to perform this action programmatically.