private int addGNoise(int pixel, Random random) {
		int v, ran;
		boolean inRange = false;
		do {
			double nextGaussian = 0;
			//nextGaussian = random.nextGaussian();
			nextGaussian = getGaussianNoise(this.mean,this.getVariance());
			ran = (int) Math.round(nextGaussian * noiseFactor);
			v = pixel + ran;
			// check whether it is valid single channel value
			inRange = (v >= 0 && v <= 255);
			if (inRange)
				pixel = v;
			// if(r++%10000==0)System.out.println(r+": "+inRange);
		} while (!inRange);
		return pixel;
	}