How to replace white background color with transparent of an image in ImageMagick?

后端 未结 4 570
有刺的猬
有刺的猬 2020-12-13 02:24

I have an image in .jpg format with white background color. I want to remove the white background color to transparent in Imagemagick.

4条回答
  •  鱼传尺愫
    2020-12-13 02:32

    You cannot have transparent background colors in your JPEGs. The JPEG file format doesn't support transparency.

    If you need transparent background, you need to convert the JPEG to

    • either PNG (high quality, filesize possibly larger than JPEG)
    • or GIF (in case you can tolerate low quality and a range of maximally 255 colors).

    Example command:

    convert  your.jpg  -transparent white  your.png
    

提交回复
热议问题