Rendre transparent le fond d’une image

L’exemple ci-dessous permet de créer une image dont le fond est transparent à partir d’une image dont le fond est blanc.

Convertir au format png

Première étape, changer de format.

convert mon_image.jpg mon_image.png

Rendre le fond transparent

Pour rendre transparent le fond blanc, on fait varier le pourcentage de l’option “fuzz” pour obtenir le résultat désiré.

convert mon_image.png -fuzz 20% -transparent white mon_image_transparente.png

Source : https://stackoverflow.com/questions/9155377/set-transparent-background-using-imagemagick-and-commandline-prompt

Nombre total de vues : 673 - Aujourd'hui : 1 vues