dodoc
dodoc copied to clipboard
supprimer le fond d'une image / recette
Exemple d'un paquet qui tourne uniquement côté client : https://github.com/imgly/background-removal-js
à creuser
Apparemment les modèles font 40 ou 80mb (!) ! Peut-être faire ça côté serveur plutôt, à voir.
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
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…