从图像中删除白色背景 [英] Remove white background from an image

查看:230
本文介绍了从图像中删除白色背景的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我希望得到一个透明的背景或没有背景的我的图片。我尝试了-background没有'选项,也是透明选项,但背景图像仍然是白色的。我怎样才能做到这一点?

I want to get a transparent background or no background for my images. I tried the '-background none' option and also the 'transparent' option, but the background image remains white. How can I achieve this?

请建议。

推荐答案

如果您正在使用Imagemagik则命令为:

If you are using Imagemagik then the command is:

convert input.gif -transparent white output.gif  

不过它只会采用了纯白色背景,而不是白色的阴影工作。
有替代性和更容易的方式用IrfanView或有Gimp或Photoshop(低于更多),以做到这一点。
这篇文章提到,您可以使用Windows自带的,而不是 CONVERT.EXE ImageMagicks Convert.exe的在这种情况下,您应该使用 Convert.exe的的完整路径。
http://www.imagemagick.org/discourse-server /viewtopic.php?f=1&t=10665

However it will only work with a pure white background and not a shade of white. There are alternative and easier ways to do this with IrfanView or The Gimp or Photoshop (more on that below). This article mentions that you may be using convert.exe that comes with Windows rather than ImageMagicks Convert.exe in which case you should use the full path for Convert.exe. http://www.imagemagick.org/discourse-server/viewtopic.php?f=1&t=10665

如果你正试图从CSS实现这一点,那么你误会CSS属性。
CSS属性背景指的是一个HTML元素的背景颜色。即< P> < D​​IV> <身体GT; 什么的。
更多在这里 http://www.w3schools.com/css/css_background.asp

If you are trying to achieve this from CSS then you misunderstand the css property. The css property 'background' refers to an html elements background color. I.e. <p> <div> <body> whatever. more here http://www.w3schools.com/css/css_background.asp

如果你指的图像不透明度属性,指的是如何看穿的形象应该是。更多在这里:
http://www.w3schools.com/Css/css_image_transparency.asp

If you are referring the the image opacity property, that refers to how "see through" an image should be. more here: http://www.w3schools.com/Css/css_image_transparency.asp

获得一个图像中的透明背景的唯一方法就是让使用图像的背景透明无论是 PNG (preferred)或 GIF 格式。为此,您可以使用的IrfanView 和保存图片为 PNG ,选择保存透明度的属性,然后选择颜色从图像你想成为透明的,也可以使用Photoshop或瘸子不这样做。例如,对于的IrfanView 的http:// llizard。 etherwork.net/cwc/transp_irfanview.html

The only way to get a transparent background in an image is to make the background of the image transparent using either the PNG (preferred) or GIF formats. For this you can use IrfanView and save a picture as PNG, select the "save transparency" property and select the color from the image you want to be transparent or you can use Photoshop or The Gimp do do the same. Example for IrfanView here http://llizard.etherwork.net/cwc/transp_irfanview.html

下面的例子瘸子 http://aplawrence.com/Linux/crousegif.html

这篇关于从图像中删除白色背景的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆