Page 1 of 1
Transparency problem
Posted: 2009-09-28T12:43:31-07:00
by laura30
I'm sure you can understand the problem.
The "1_t.png" file was generated by ImageMagick.
Thanks in advance for any help with this.
Re: Transparency problem
Posted: 2009-09-28T19:54:51-07:00
by fmw42
Have no idea what the problem is! What were your two command lines that generated the two images?
Please read
viewtopic.php?f=1&t=9620
Re: Transparency problem
Posted: 2009-09-28T20:41:39-07:00
by el_supremo
Presumably you're trying to turn the white background in the left image into either black or transparent background.
Either way you need to add -fuzz to the command
See:
http://www.imagemagick.org/script/comma ... s.php#fuzz
The easiest way is to use a percentage such as: -fuzz 15%
Pete
Re: Transparency problem
Posted: 2009-09-28T21:12:30-07:00
by fmw42
el_supremo is correct if that is what you are trying to do
convert inputimage -fuzz XX% -fill black -opaque white outputimage
Re: Transparency problem
Posted: 2009-10-05T16:39:25-07:00
by anthony
With hair the problem becomes much more difficult than a simple fuzz factor.
You either still leave a light colored halo, OR you loose small strands of hair.
Some form of anti-aliased background removal is needed, to re-generate the background. However you need to generate two values for each pixel to re-generate that background. the original color of the 'hair' are each point, and the amount of transparency to give that point.
The hair layered on a single white background will not provide enough info to do this properly. However if you have two images, on layered on white, the other on say black, then it should be posible to determine the original color and transparency of each pixel.
That is for each pixel you have two colors, one layered on white, the other on black. From this you should be able to determine the original alpha, and color components.
I have not determined the mathematics for this, but it is something I have a strong interest in solving, as an alternative and perfect way to restoring an images original transparency.
PS: an overlay of the same image on any two different known colors should allow you to (in general) restore an images transparency perfectly!