public List<Pixel> neighbours(int width, int height)
    {
        List<Pixel> result = new ArrayList<Pixel>(8);
        for(int i = -1; i <= 1; i++)
        {
            for(int j = -1; j <= 1; j++)
            {
                if(i != 0 || j != 0)
                {
                    int newX = x + i;
                    int newY = y + j;

                    if(newX >= 0 && newX < width && newY >= 0 && newY < height)
                    {
                        result.add(new Pixel(newX,newY));
                    }
                }
            }
        }

        return result;
    }