dodoc icon indicating copy to clipboard operation
dodoc copied to clipboard

supprimer le fond d'une image / recette

Open louis-ev opened this issue 9 months ago • 2 comments

Exemple d'un paquet qui tourne uniquement côté client : https://github.com/imgly/background-removal-js

à creuser

louis-ev avatar May 01 '24 19:05 louis-ev

Apparemment les modèles font 40 ou 80mb (!) ! Peut-être faire ça côté serveur plutôt, à voir.

louis-ev avatar May 01 '24 19:05 louis-ev

Peut être jouable avec ffmpeg : https://superuser.com/a/1749888

ffmpeg -i input.jpg -vf colorkey=white:0.3:0.5 out.png

Change 0.3 to 0.01 if you want only white(#ffffff) to be affected, without close colors.

Change 0.5 to whatever transparency amount you want, 0.0 will be fully transparent.

More info here.

https://www.ffmpeg.org/ffmpeg-filters.html#colorkey

louis-ev avatar May 10 '24 18:05 louis-ev

Découvert à l'instant : https://github.com/addyosmani/bg-remove Très puissant, propre, je suis bluffé. 20mo a charger côté client par contre…

louis-ev avatar Feb 01 '25 21:02 louis-ev