public int[] getImagePixels(String filename, int width, int height) throws IOException 
	{
		File f = new File(filename);
		BufferedImage image = ImageIO.read(f);
		//rescale to resample pixel data
		Image scaledImage = image.getScaledInstance(width, height, 1);
		
		PixelGrabber grabber;
		int[] pixels = new int[scaledImage.getWidth(this) * scaledImage.getHeight(this)];
		try
	        {
			grabber = new PixelGrabber(scaledImage, 0, 0, scaledImage.getWidth(this), scaledImage.getHeight(this), pixels, 0, scaledImage.getWidth(this));
			grabber.grabPixels(0);
			
		} 
	        catch (Exception e)
	        {
			   e.printStackTrace();
		   }
	        
	    // setting a white border around the image, so that it doesn't create out of bounds problems when building the maze from array data
	    // first row
	    for(int i = 0; i < scaledImage.getWidth(this); i++){
	    	pixels[i] = -1;
	    }
	    // last row
	    for(int i = scaledImage.getWidth(this) * scaledImage.getHeight(this) - scaledImage.getWidth(this); i < scaledImage.getWidth(this) * scaledImage.getHeight(this); i++){
	    	pixels[i] = -1;
	    }
	    // rightmost row
	    for(int i = scaledImage.getWidth(this)-1; i < scaledImage.getWidth(this) * scaledImage.getHeight(this); i += scaledImage.getWidth(this)){
	    	pixels[i] = -1;
	    }
	    //leftmost row
	    for(int i = 0; i < scaledImage.getWidth(this) * scaledImage.getHeight(this); i+=scaledImage.getWidth(this)){
	    	pixels[i] = -1;
	    }
		return pixels;
	}