public void putSubImage(int x, int y, ImageAccess input){
	    if (input == null)
			throw new ArrayStoreException("putSubImage: input == null.");
	    if (x < 0 )
			throw new IndexOutOfBoundsException("putSubImage: x < 0.");
	    if (y < 0)
			throw new IndexOutOfBoundsException("putSubImage: y < 0.");
	    if (x >= nx)
			throw new IndexOutOfBoundsException("putSubImage: x >= nx.");
	    if (y >= ny)
			throw new IndexOutOfBoundsException("putSubImage: y >= ny.");
	 	int nxcopy=input.getWidth();
	 	int nycopy=input.getHeight();
	 	// Reduces the size of the area to copy if it is too large
		if (x+nxcopy>nx) 
			nxcopy = nx-x;
		if (y+nycopy>ny) 
			nycopy = ny-y;
		// Copies lines per lines
		double[] dsrc = input.getPixels();
		for ( int j=0; j<nycopy; j++)
			System.arraycopy(dsrc, j*nxcopy, pixels, (j+y)*nx+x, nxcopy);
	}