Using a Mac with ImageMagick 6.9.1-10, how can I remove this background and make it transparent?
Thanks.
Make Simple Background Transparent
- fmw42
- Posts: 25562
- Joined: 2007-07-02T17:14:51-07:00
- Authentication code: 1152
- Location: Sunnyvale, California, USA
Re: Make Simple Background Transparent
What is background? Is it just the color outside the darker brown region or is it everything but the sofa/chair? Either way, it will be very hard, since the chair color is similare to the rest of the image. If you have a picture that is the same but without the chair, then you can try subtracting that from the image. Otherwise, you will have to manually draw a black/white mask and use that to make the background transparent using
Code: Select all
convert Modwoosof.jpeg mask -alpha off -compose copy_opacity -composite result.png
Re: Make Simple Background Transparent
If it is the area outside the brown region could you add a border the same colour, floodfill ( can you floofill transparent? ) and then crop or shave back to the original?
-
- Posts: 12159
- Joined: 2010-01-23T23:01:33-07:00
- Authentication code: 1151
- Location: England, UK
Re: Make Simple Background Transparent
The answer is easy: do it in Gimp.
I'm serious. IM is not the right tool for this job.
But perhaps there is something the OP hasn't said. Perhaps there are 1000 images, all with the same background, which is to be removed. Or something.
I'm serious. IM is not the right tool for this job.
But perhaps there is something the OP hasn't said. Perhaps there are 1000 images, all with the same background, which is to be removed. Or something.
snibgo's IM pages: im.snibgo.com
Re: Make Simple Background Transparent
No joke, there are thousands of these.snibgo wrote:But perhaps there is something the OP hasn't said. Perhaps there are 1000 images, all with the same background, which is to be removed. Or something.
The problem is that making them transparent in Photoshop or GIMP for these would be very tedious
The background's the orange thing.
Is there a way to make that actually go away or not?
- fmw42
- Posts: 25562
- Joined: 2007-07-02T17:14:51-07:00
- Authentication code: 1152
- Location: Sunnyvale, California, USA
Re: Make Simple Background Transparent
If the brown "ring" goes all the way round inside the image boundary, then you can do what bonzo suggested. Add the same background color to a border of at least one pixel wide, then make that color transparent.
Assuming that the upper left corner pixel is always your background color, then this works.
The -fuzz 10% is needed, since you have a jpg input and the jpg compression makes the background not a constant color, but slightly off in blocks.
Assuming that the upper left corner pixel is always your background color, then this works.
Code: Select all
bgcolor=`convert 8m3q3jS.jpg -format "%[pixel:u.p{0,0}]" info:`
convert 8m3q3jS.jpg -bordercolor $bgcolor -border 1 \
-fuzz 10% -fill none -draw "matte 0,0 floodfill" -shave 1x1 8m3q3jS_trans.png
The -fuzz 10% is needed, since you have a jpg input and the jpg compression makes the background not a constant color, but slightly off in blocks.
-
- Posts: 12159
- Joined: 2010-01-23T23:01:33-07:00
- Authentication code: 1151
- Location: England, UK
Re: Make Simple Background Transparent
These two images seem to have the same background. Are they the same size? Then find a set of images such that at every pixel is the background on at least one image. Then you can make an image that is entirely background. Then, for every image, were a pixel isn't background, it's a foreground pixel.
I hope your files aren't jpeg. If they are, you'll need fuzz and probably noise-reduction.
I hope your files aren't jpeg. If they are, you'll need fuzz and probably noise-reduction.
snibgo's IM pages: im.snibgo.com