File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
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
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: 7779
    
  21

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