d2jsp
Log InRegister
d2jsp Forums > Off-Topic > General Chat > Homework Help > Javascript Help
Add Reply New Topic New Poll
Member
Posts: 1,781
Joined: Mar 16 2007
Gold: 0.00
Apr 16 2013 05:28pm
I have this code, which (I hope) locates green pixels to replace and then red pixels to replace.

public void chromakey2(Picture pictForGreen, Picture pictForRed)
{
int x;
x = 0;
while( x < this.getWidth() )
{
int y;
y = 0;
while( y < this.getHeight() )
{ Pixel pixRef = getPixel(x,y);
if( pixRef.getGreen() >
(pixRef.getBlue() + pixRef.getRed())*0.65 &&
pixRef.getBlue() > pixRef.getRed() )
{

Pixel gPixRef = pictForGreen.getPixel( x, y);
Color replacementColor = gPixRef.getColor();
pixRef.setColor( replacementColor );
}
{

if(pixRef.getRed() >
(pixRef.getBlue() + pixRef.getGreen())*0.65 &&
pixRef.getBlue()> pixRef.getGreen())
{
Pixel rPixRef = pictForRed.getPixel(x, y);
Color replacementColor = rPixRef.getColor();
pixRef.setColor(replacementColor);
}
}
y = y + 1;
}
x = x + 1;
}
}

I have another application where all I have coded is:
public class ChromakeyApp extends Picture
{
public static void main(String[]a)
{
FileChooser.pickMediaPath();
Picture pOrigRef = new Picture( FileChooser.pickAFile() );

}

}
I need to be able to let me choose the outputs of: an original picture, that original picture with the green and red pixels replaced with 2 different picture files, and the original pictures pixels replaced with another different picture file.
Any clues?
Member
Posts: 3,541
Joined: May 13 2007
Gold: 4,442.00
Apr 25 2013 07:54pm
How much you paying?
Member
Posts: 1,781
Joined: Mar 16 2007
Gold: 0.00
Apr 25 2013 08:48pm
this is done, i have another thread asking for help if you're interested though
Go Back To Homework Help Topic List
Add Reply New Topic New Poll