Jump to content

  • Log In with Google      Sign In   
  • Create Account

Banner advertising on our site currently available from just $5!


1. Learn about the promo. 2. Sign up for GDNet+. 3. Set up your advert!


#ActualTournicoti

Posted 21 February 2013 - 07:10 AM

Hello

 

I'm trying to make an image filter that computes the optimal transparency key for alpha test purposes.

 

First it computes the average color at the bounds.

Then it should find the closest color of this color (that is not present in the image) to fill RGB transparent areas.

 

My problem is : given a manhattan distance, how to find all the permutations of the given color ?

 

For example for distance=1, the permutations are :

(red+1,green,blue)

(red-1,green,blue)

(red,green+1,blue)

(red,green-1,blue)

(red,green,blue+1)

(red,green,blue-1)

 

Thanks for your help =)

 

Nico


#1Tournicoti

Posted 21 February 2013 - 07:08 AM

Hello

 

I'm trying to make an image filter that computes the optimal transparency key for alpha test purposes.

 

First it computes the average color at the bounds.

Then it should find the closest color of this color (that is not present in the image) to fill RGB transparent areas.

 

My problem is : given a manhattan distance, how to find all the premutations of the given color ?

 

For example for distance=1, the permutations are :

(red+1,green,blue)

(red-1,green,blue)

(red,green+1,blue)

(red,green-1,blue)

(red,green,blue+1)

(red,green,blue-1)

 

Thanks for your help =)

 

Nico


PARTNERS