import tensorflow as tf

		# rgb.set_shape([h,w,c]) # don't set because going to crop anyway

		# crop for lsun 96, see realnvp and glow for specifics
		rgb = tf.image.random_crop(rgb,size=[h,w,c])

		# crop for patch training
		crop_h = h//self.crop_factor
		crop_w = w//self.crop_factor
		rgb = tf.image.random_crop(rgb,size=[crop_h,crop_w,c])

		# random left-right flops
		rgb = tf.image.random_flip_left_right(rgb)

		# cast, bit conversion, compress domain, center
		rgb = tf.cast(rgb, tf.float32)
		if n_bits < 8:
			rgb = tf.floor(rgb/(2**(8-n_bits)))
		rgb = rgb/(n_bins) - 0.5

		return rgb

	def post_process(self, rgb, add_dequantization_noise=True):
