def __init__(self, im, bbox = None, depth = 0, blocksize = 32):

		if bbox == None:
			bbox = BBox(0,0, im.size[0], im.size[1])
		self.blocksize = blocksize
		self.depth = depth
		self.bbox = bbox
		self.im = im
		self.children = None
		self.type = BlockType.UNKNOWN

		if bbox.w > self.blocksize and bbox.h > self.blocksize:
			#if we are far enough up the tree to consider splitting:

			#generate the child bboxes
			childboxes = [BBox(bbox.x, bbox.y, bbox.w/2, bbox.h/2),
						  BBox(bbox.x+bbox.w/2, bbox.y, bbox.w - bbox.w/2, bbox.h/2),
						  BBox(bbox.x, bbox.y+bbox.h/2, bbox.w/2, bbox.h-bbox.h/2),
						  BBox(bbox.x+bbox.w/2, bbox.y+bbox.h/2, bbox.w/2 - bbox.w, bbox.h-bbox.h/2)]

			#figure out the child image types
			childtypes = [ Analyze(im, childboxes[0]),
						   Analyze(im, childboxes[1]),
						   Analyze(im, childboxes[2]),
						   Analyze(im, childboxes[3])]

			same_type = childtypes[0] == childtypes[1] == childtypes[2] == childtypes[3]
			last_div = bbox.w/2 < self.blocksize or bbox.h /2 < self.blocksize

			if same_type and (childtypes[0] != BlockType.ALPHA or last_div):
				#stop iterating, we've hit the bottom
				self.type = childtypes[0]
			else:
				#otherwise, split up the children
				self.children = (
					QuadTreeNode(im, childboxes[0], depth+1, self.blocksize),
					QuadTreeNode(im, childboxes[1], depth+1, self.blocksize),
					QuadTreeNode(im, childboxes[2], depth+1, self.blocksize),
					QuadTreeNode(im, childboxes[3], depth+1, self.blocksize))

			if self.children and len(self.children) == 4 and self.children[0].type == self.children[1].type == self.children[2].type == self.children[3].type == BlockType.ALPHA:
				self.children = None
				self.type = BlockType.ALPHA
		else:
			self.type = Analyze(im, bbox)
dataset/ETHPy150Open kleientertainment/ds_mod_tools/pkg/unix/mod_tools/tools/scripts/optimizeimage.py/QuadTreeNode.__init__/swapped operands of `-`