This week's book giveaway is in the OCMJEA forum.
We're giving away four copies of OCM Java EE 6 Enterprise Architect Exam Guide and have Paul Allen & Joseph Bambara on-line!
See this thread for details.
The moose likes Beginning Java and the fly likes Chromakey using 2d arrays Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of OCM Java EE 6 Enterprise Architect Exam Guide this week in the OCMJEA forum!
JavaRanch » Java Forums » Java » Beginning Java
Bookmark "Chromakey using 2d arrays" Watch "Chromakey using 2d arrays" New topic
Author

Chromakey using 2d arrays

Jamal Nasar
Greenhorn

Joined: Mar 06, 2013
Posts: 2
First time posting here, hope I'm formatting this right:

I'm having some trouble writing a chromaKey method that basically takes two images, one with a green screen and the other a background, and makes a new image replacing the green-screen with the background.
After compiling, when I try to run it, I get an ArrayIndexOutofBoundsException on the line:



Can someone point me in the right direction?

Winston Gutkowski
Bartender

Joined: Mar 17, 2011
Posts: 7713
    
  20

Jamal Nasar wrote:After compiling, when I try to run it, I get an ArrayIndexOutofBoundsException on the line:

Well, the only reason for that would be that either pixels or background.pixels has a length of 0; but since you haven't shown us how those are created, it's impossible to guess why.

My suggestion: StopCoding and write down what you're trying to achieve.

Winston

Isn't it funny how there's always time and money enough to do it WRONG?
Articles by Winston can be found here
Jamal Nasar
Greenhorn

Joined: Mar 06, 2013
Posts: 2
Thanks for the suggestion Winston, I added in the rest of the code so the method makes sense in context and I'll try looking for what's causing the length issue in the meanwhile.
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Chromakey using 2d arrays