예제 #1
0
def plot_grid(images, tsne, tx, ty):
    nx = int(math.ceil(math.sqrt(len(images))))
    ny = nx

    grid_assignment = rasterfairy.transformPointCloud2D(tsne, target=(nx, ny))

    tile_width = 144
    tile_height = 112

    full_width = tile_width * nx
    full_height = tile_height * ny
    aspect_ratio = float(tile_width) / tile_height

    grid_image = PIL.Image.new('RGB', (full_width, full_height))

    for img, grid_pos in tqdm.tqdm(zip(images, grid_assignment[0].tolist())):
        idx_x, idx_y = grid_pos
        x, y = tile_width * idx_x, tile_height * idx_y
        tile = imageutils.load_image(img)
        tile_ar = float(
            tile.width
        ) / tile.height  # center-crop the tile to match aspect_ratio
        if (tile_ar > aspect_ratio):
            margin = 0.5 * (tile.width - aspect_ratio * tile.height)
            tile = tile.crop(
                (margin, 0, margin + aspect_ratio * tile.height, tile.height))
        else:
            margin = 0.5 * (tile.height - float(tile.width) / aspect_ratio)
            tile = tile.crop((0, margin, tile.width,
                              margin + float(tile.width) / aspect_ratio))
        tile = tile.resize((tile_width, tile_height), PIL.Image.ANTIALIAS)
        grid_image.paste(tile, (int(x), int(y)))

    return grid_image
예제 #2
0
def plot_grid(images, texts=None, tile_size=120):
    n = int(math.ceil(math.sqrt(len(images))))
    full_size = tile_size * n
    grid_image = PIL.Image.new('RGB', (full_size, full_size))
    for i, img in enumerate(images):
        logging.debug('Adding image {}({}) {}'.format(i, len(images), img))
        x, y = (i % n) * tile_size, (i // n) * tile_size
        tile = imageutils.load_image(img)
        margin = abs((tile.width - tile.height) // 2)
        if (tile.width > tile.height):
            tile = tile.crop((margin, 0, margin + tile.height, tile.height))
        else:
            tile = tile.crop((0, margin, tile.width, margin + tile.width))
        tile = tile.resize((tile_size, tile_size), PIL.Image.ANTIALIAS)
        draw = PIL.ImageDraw.Draw(tile)
        if texts:
            for font_height in range(tile_size // 5, 1, -1):
                font = get_font(font_height)
                text_width, _ = font.getsize(texts[i])
                if text_width < tile_size:
                    break
            draw.text((0, tile_size - font_height),
                      texts[i], (255, 255, 0),
                      font=font)
        grid_image.paste(tile, (x, y))

    return grid_image
예제 #3
0
def _grey(image):
    img = imageutils.load_image(image, method='CV2')
    if img.ndim == 3:
        grey = cv2.cvtColor(img, cv2.COLOR_BGR2GRAY)
    else:
        grey = img
    return grey
예제 #4
0
 def getfile(self, texture_path):
     if texture_path in Shape.loaded_images:
         return Shape.loaded_images[texture_path]
     else:
         image, rect = imageutils.load_image(texture_path, -1)
         rect = image.get_rect(center=rect.center)
         rect.move_ip((-image.get_width()/2, -image.get_height()/2))
         Shape.loaded_images[texture_path] = image
         return image
예제 #5
0
def get_image(path, target_size):
    try:
        img = imageutils.load_image(path=path, target_size=target_size)
        x = keras.preprocessing.image.img_to_array(img)
        x = np.expand_dims(x, axis=0)
        x = keras.applications.imagenet_utils.preprocess_input(x)
        return img, x
    except Exception as e:
        logging.warning("Failed to handle {} ({})".format(path, e))
        return None, None
예제 #6
0
 def __init__(self, scoreboard, timer):
     self.scoreboard = scoreboard
     self.timer = timer
     
     # Create empty background
     x = random.choice([1,2,3,4,6,7,9])
     self.background = imageutils.load_image("BG_%s.png" % x)[0].convert()
     
     # Create Layers
     self.player_layer = pygame.sprite.RenderPlain()
     self.enemy_layer = pygame.sprite.RenderPlain()
예제 #7
0
def plot_tsne(images, tsne, tx, ty):
    width = 4000
    height = 3000
    max_dim = 100

    full_image = PIL.Image.new('RGBA', (width, height))
    for img, x, y in tqdm.tqdm(zip(images, tx, ty)):
        tile = imageutils.load_image(img)
        rs = max(1, tile.width / max_dim, tile.height / max_dim)
        tile = tile.resize((int(tile.width / rs), int(tile.height / rs)),
                           PIL.Image.ANTIALIAS)
        full_image.paste(tile, (int(
            (width - max_dim) * x), int((height - max_dim) * y)),
                         mask=tile.convert('RGBA'))

    return full_image
def build_file_segments(directory):
    """
    Builds a dict mapping all filepaths in @param directory to Segments with a 1D list for its right col
    and left col

    @param directory: path to directory containing slices
@return: dict of filepath -> Segment
    """
    files_names = imageutils.files_in_directory(directory)

    files = {}

    for file_name in files_names:
        img_arr = imageutils.load_image(file_name)
        files[file_name] = Segment(tuple(img_arr[0]), tuple(img_arr[-1]))

    return files
                    if first_overlap_score <= second_overlap_score:
                        best_overlap_score = first_overlap_score
                        first_slice_on_left = True
                    else:
                        best_overlap_score = second_overlap_score
                        first_slice_on_left = False
                first_slice_index = first_slice_index
        if first_slice_on_left:
            slices[first_index] += slices[second_index]
            slices.pop(second_index)
        else:
            slices[second_index] += slices[first_index]
            slices.pop(first_index)

    return slices[0]
    
"""
TA Grading Comment:
Yeesh. A little messy. I get it was the last one and you wanted to knock it out.
"""

if __name__ == '__main__':
    DATA_FILES = 'shredded/destination'

    slices = list()
    for f in imageutils.files_in_directory(DATA_FILES):
        piece = imageutils.load_image(f)
        slices.append(piece)

    imageutils.show_image(reconstruct_slices(slices))
def get_image_array(filename):
	""" Returns the image array for the given filename, using imageutils.
	"""
	return imageutils.load_image(filename)
예제 #11
0
 def __init__(self, screen, scoreboard):
     self.screen = screen
     self.background = imageutils.load_image("BG_gameover.png")[0].convert()  
     self.scoreboard = scoreboard
	return answer

if __name__ == '__main__':
    """
    Puts together the slices and store it as a file named 'map'
    Also prints the corresponding message on console.
    
    MESSAGES:
    1) HOLY
    2) YOU FOUND A MESSAGE!
    """
    IMAGE_DIRECTORY = 'shredded/destination'
    files = iu.files_in_directory(IMAGE_DIRECTORY)

    # Stores tuple (filename, pixels)
    slices = [(fn, iu.load_image(fn)) for fn in files]
    answer = glue_together(slices)
    tm = []
    kw = ""
    for a in answer:
    	kw += slices[a][0][-5]
    	tm += slices[a][1]
    iu.save_image(tm, 'map')
    print(kw)


#great decomposition on this one! loved the functional programming of this one



# Computes the difference between all the components of two pixels.
# sqrts it to value matches with most very close and a few far away
# over those that are somewhat close across the board.
# Both args are imageutils pixels. Returns a float.
def pixDiff(pix1, pix2):
  return sqrt(sum([abs(com[0]-com[1]) for com in zip(pix1, pix2)]))
  
# Computes the sum of the differences amonst all the pixels in the
# rightmost edge of lhs and leftmost edge of rhs. Both args are 
# tuples of imageutils pixels. Returns a float.
@lru_cache(maxsize=None)
def colDiff(lhs, rhs):
  return sum([pixDiff(pixs[0], pixs[1]) for pixs in zip(lhs, rhs)])

if __name__ == '__main__':
  strips = [list(map(tuple, imageutils.load_image(file))) for file in imageutils.files_in_directory(dir)]
  """
  TA Grading Comment:
  file is a keyword watch out
  
  True = False
  """
  while len(strips) > 1:
    besti, bestj, bestDiff = 0, 0, -1
    for i in range(len(strips)):
      for j in range(len(strips)):
        if i == j: continue
        diff = colDiff(strips[i][-1], strips[j][0])
        if bestDiff == -1 or diff < bestDiff:
          bestDiff, besti, bestj = diff, i, j
    strips[besti] += strips[bestj]
예제 #14
0
    times = 0
    temp = (0, 0, 0, 0)
    result = []
    for eye in eyes:
        if times == 0:
            temp = eye
        elif times == 1:
            if temp[0] < eye[0]:
                result.append(eye)
            else:
                result.append(temp)
        times += 1
        if times > 1:
            times = 0
    return result


def detect_mouth(image):
    return _detect_organ_on_face(image, "data/haarcascade_mcs_mouth.xml", 1.1,
                                 3, 4, 0.3, 0.5)


if __name__ == '__main__':
    image = "d:/face.jpg"
    result = detect_eyes(image)
    img = imageutils.load_image(image, method='CV2')
    for (x1, y1, x2, y2) in result:
        mouth = img[y1:y2, x1:x2]
    cv2.imshow("eyes", img)
    cv2.waitKey()
					first_index = first_slice_index
					second_index = second_slice_index
					if left_overlap_score <= right_overlap_score:
						best_overlap_score = left_overlap_score
						first_on_left = True
					else:
						best_overlap_score = right_overlap_score
						first_on_left = False

		if first_on_left:
			slices[first_index] += slices[second_index]
			slices.pop(second_index)
		else:
			slices[second_index] += slices[first_index]
			slices.pop(first_index)
	return slices[0]

if __name__ == '__main__':
	"""
	Constructs and opens the image formed by the slices in DATA_LOCATION.
	"""
	DATA_LOCATION = 'shredded/destination'
	slices = []
	for file in imageutils.files_in_directory(DATA_LOCATION):
		image_slice = imageutils.load_image(file)
		slices.append(image_slice)
	final_image = reconstruct_slices(slices)
	imageutils.show_image(final_image)


def compare(x1, y1):
    x = imageutils.load_image(x1)
    y = imageutils.load_image(y1)
    return compareColumns(x, y)
in the program design. As such, take a moment to plan out your approach
to this problem. How will you merge the image slices? You can import any
builtin libraries you need (i.e. itertools, operator, etc), but do not
use any 3rd party libraries (outside of Pillow, which we've provided
through the imageutils module)

Best of luck! Now go find that Holy Grail.
"""
import imageutils
import itertools


if __name__ == '__main__':
    images = []
    for filename in imageutils.files_in_directory('shredded/grail4'):
        images.append(imageutils.load_image(filename))
    imageutils.show_all_images(images)
    reassembled_image = reassemble(images)
    imageutils.show_image(reassembled_image)

'''
***** alternatively, for pixel_similarity1 you can use the fact that pixels are tuples:

return sum([(component[0] - component[1])**2 for component in zip(p1, p2)])

'''
def pixel_similarity1(pixel1, pixel2):
    return (pixel1.red - pixel2.red)**2 + (pixel1.green - pixel2.greem)**2 + (pixel1.blue - pixel2.blue)**2 + (pixel1.alpha - pixel2.alpha)**2

'''
***** nice list comprehension and use of sum/zip functions
            best_score = sim
            best_pair = (pair[0], pair[1])
    return best_pair


def stitch(imgs):
    """
    FUNCTION: stitch

    Stitches together all the shreds specified in imgs by searching for the
    pairs with highest similarity and iteratively reassembling the image.

    @params: imgs: dict mapping a unique key to a 2D array representing an
    image slice.
    @return: reassembled image represented via 2D array.
    """
    while len(imgs) > 1:
        pair = get_best_pair(imgs)
        stitched = imgs[pair[0]] + imgs[pair[1]]  # Combine the pair of slices.
        del imgs[pair[0]]  # Delete the slices we just used ...
        del imgs[pair[1]]
        # ...and create a unique key & store the new slice
        imgs["({})-({})".format(*pair)] = stitched
    return imgs.popitem()[1]

if __name__ == '__main__':
    # Associate each 2D array with a unique key
    imgs = {i: imageutils.load_image(filename) for i, filename in enumerate(
        imageutils.files_in_directory("./shredded/grail20"))}
    imageutils.show_image(stitch(imgs))
    """
    files_names = imageutils.files_in_directory(directory)

    files = {}

    for file_name in files_names:
        img_arr = imageutils.load_image(file_name)
        files[file_name] = Segment(tuple(img_arr[0]), tuple(img_arr[-1]))

    return files

if __name__ == '__main__':

    Segment = namedtuple('Segment', 'left_col, right_col')

'''
***** good decomp, but here's a very pythonic way to load the files:

files = dict(zip(imageutils.files_in_directory(dir), map(imageutils.load_image, imageutils.files_in_directory(dir))))

'''
    files = build_file_segments(DIR_NAME)
    ordered_file_names = build_image(files)

    files_list = [imageutils.load_image(file_name)
                  for file_name in ordered_file_names.split('\t')]
    imageutils.show_all_images(*files_list, buffer_width=0)

    # prints message
    #print(''.join( [f[len(f) - 5] for f in ordered_file_names.split('\t')] ) )
def compare_shreds(right_col_shred, left_col_shred, column_compare_func):
    """
    Compares the right-most column of one shred to the left-most column of another
    using provided comparison function

    returns the similarity score for the two columns
    """
    return column_compare_func(right_col_shred[-1], left_col_shred[0], cosine_similarity)


if __name__ == "__main__":
    SHREDS_DIR = "shredded/destination/"
    shred_files = iu.files_in_directory(SHREDS_DIR)[1:]
    shreds = []
    for filename in shred_files:
        shreds.append(iu.load_image(filename))

        ##Note: in the future—make your code a bit more modular and decompose this main function a bit!

    # ordered_shreds will contain the shreds reassembled in the correct order
    ordered_shreds = [shreds.pop(0)]
    # while unordered shreds remain
    while len(shreds) > 0:
        max_right_to_left_sim = float("-Inf")
        candidate_insert_right_shred = None
        max_left_to_right_sim = float("-Inf")
        candidate_insert_left_shred = None
        # loop over all remaining shreds
        for shred in shreds:
            # compare the right-most ordered shred for a right<-left match
            right_to_left_sim = compare_shreds(ordered_shreds[-1], shred, average_similarity)
		highestOne.append(column)


def mergeClosestSlices(slices):
	"""
	Gets the two closest slices and merges them together
	"""
	lowestSimilarity = 9999999999999
	for left in slices:
		for right in slices:
			if left != right:
				currSim = sliceSimilarity(left, right)
				if currSim < lowestSimilarity:
					lowestSimilarity = currSim
					leftHigh = left
					rightHigh = right
	mergeSlices(leftHigh, rightHigh)
	slices.remove(rightHigh)


if __name__ == '__main__':
	slices = []
	for image in imageutils.files_in_directory("shredded/destination"):
		slices.append(imageutils.load_image(image))
	while len(slices) > 1:
		mergeClosestSlices(slices)
	imageutils.show_image(slices[0])


		
    while(num_slices > 1):
        highest = 442.0
        for i_ind, i in enumerate(slices):
            for j_ind, j in enumerate(slices):
                if i != j:
                    sim = slice_similarity(i, j)
                    if sim < highest:
                        highest = sim 
                        highest_ind[0] = i_ind
                        highest_ind[1] = j_ind
        slices[highest_ind[0]] = slices[highest_ind[0]] + slices[highest_ind[1]]
        slices.remove(slices[highest_ind[1]])
        num_slices -= 1
    return slices[0]

if __name__ == '__main__':
    """
    Opens directory of image slices and translates into list pixel arrays, 
    then stiches together original image and opens it
    """
    file_names = imageutils.files_in_directory('shredded/destination')

    slices = []
    for file in file_names:
        pixels = imageutils.load_image(file)
        slices.append(pixels)
    imageutils.show_image(stitch(slices))


#great functional programming on this one!
	Returns the final merged image.
	"""
	if not onleft:
		return merge(image2, image1, True)

	finalimage = image1

	for col in image2:
		finalimage.append(col)
	return finalimage

if __name__ == '__main__':
	images = [] #the holder for image data
	for file in [doc for doc in os.listdir(PATH_NAME)]: #importing all images into images
		images.append(iu.load_image(PATH_NAME + file))

	""" Named tuple that contains score information, orientation, and an image """
	Score = collections.namedtuple('Score', ['score','onleft', 'image'])

	###the below could have been modularized a bit more and be decomposed into different functions###

	""" Iterates until there is only one image left and merges most similar images """
	while (len(images) > 1):
		for image in images:
			images.remove(image)
			bestScore = Score(-1, True, None) #True for image on left
			for otherimage in images:
				if otherimage == None:
					break
				currminscore = findCurrScore(image, otherimage)
def get_all_images():

    '''
    Gets all the images from the named file (relative path) and places them in a dict
    with an number key for each picture array. I'll use that key throughout to track the
    proper reordering of the slices. Returns dict.
    '''
    pic_map = {}
    pic_files = imageutils.files_in_directory("shredded/destination")

    pic_key = 0

    for pic in pic_files:

    pic_col_array = imageutils.load_image(pic)
pic_map[pic_key] = pic_col_array
pic_key += 1

return pic_map


def pixel_similarity(base_pixel, cmp_pixel):

    '''
    Basic helper that computes the similarity score between two pixels by finding the square
    of the absolute value of the difference between each Pixel field (RGBA) and suming those diffs
    The larger the return value, the less similar
    '''

    diffs = []
    diffs.append(abs(base_pixel.red - cmp_pixel.red)**2)
    diffs.append(abs(base_pixel.green - cmp_pixel.green)**2)
    diffs.append(abs(base_pixel.blue - cmp_pixel.blue)**2)
    diffs.append(abs(base_pixel.alpha - cmp_pixel.alpha)**2)
    return sum(diffs)


def column_similarity(rightmost_piece, leftmost_piece):

    '''
    Takes two pieces, which are one-column slices from the larger slice and computes their 
    similarity. Run a for loop over over each pixel down the two columns, passing each pixel 
    pair to pixel_similarity. Returns similarity score for the columns, which is equivalent to 
    simiarlity score for two slices, because the columns represent rightmost and leftmost column of 
    two slices, respectively.
    '''
    
    sim_score_list = []

    for n in range(len(rightmost_piece)):
    sim_score_list.append(pixel_similarity(rightmost_piece[n], leftmost_piece[n]))

    return sum(sim_score_list)





def slice_similarity(this_slice, this_key, slice_map, master_repository):

    '''
    Computes the similarity scores for one slice compared against every other slice from the picture. 

    Grabs the rightmost column from base slice (since that's where we would glue it to another slice) and 
    then grabs the leftmost column of every other slice, comparing each right-left pair for similarity. 
    Places the similarity score into a dict, with the key being a tuple indicating which two slices (which pair)
    that similarity score represents.
    '''
    #need to grab rightmost piece from this_slice and left_most from every other slice
    rightmost_piece = this_slice[-1]


    #compute similarity scores between this key and every other slice
    for key, other_slice in slice_map.items():

        if(key != this_key):
        leftmost_piece = other_slice[0]
    pair_score = column_similarity(rightmost_piece, leftmost_piece)

master_repository[tuple([this_key, key])] = pair_score



def piece_image_together(master_repository, slice_map):

    '''
    Takes the master_repo, which is the dictionary with all the similarity scores in it, and uses it to 
    figure out which slices ought to be glued together. Does this by: 

    - Sorting the repo such that the most similar slice pairing are first in the repo
    - Iterating through the sorted repo to grab the next-most-similar pair and gluing those two 
      together. Builds a list that contains the tuples in the order in which they should be combined
    - Passes that list of tuples to the helper "stich_list", which turns the tuples into one ordered list
      without any repeating key numbers. The result lists the slices in the order in which they should be combined
    - Then combines those slices from the slice_map into one 2D array and calls show_image
    '''
    already_combined_keys = list()
    final_order_list = []

    sorted_repo = sorted(master_repository, key=(lambda k: master_repository[k]))

    
    counter = 0
    for key in sorted_repo:
    #max_key = max(slice_map.keys(), key=(lambda k: len(slice_map[k])))

    if(counter == (len(slice_map) - 1)):
break

if(key in already_combined_keys):
    continue

final_order_list.append(key)
key1, key2 = key

already_combined_keys.append(tuple([key2, key1]))
key2_list = list(filter(lambda key: key[1] == key2, master_repository))

for two_key in key2_list:
    already_combined_keys.append(two_key)

counter += 1

init_start, init_end = final_order_list[0]
sub_list = []
sub_list.append(init_start)
sub_list.append(init_end)
final_order = stitch_list(sub_list, init_start, init_end, final_order_list)

build_final_pic_array(final_order, slice_map)


def build_final_pic_array(final_order, slice_map):
    '''
    Takes final_order array, which lists the slices in the order they should be combined (identifying
    each by its key number) and builds the final slice_map according. Passes that final slice array to 
    show_image to get the picture
    '''

    start = final_order[0]
    for n in final_order:
    if(n != start):
slice_map[start] += slice_map[n]

imageutils.show_image(slice_map[start])


def stitch_list(sub_list, start, end, final_order_list):

    '''
    Recursive function that takes the list of tuples which shows the slice pairings that ought 
    to be glued and turns all those pair tuples into one continuous list, from leftmost slice to 
    rightmost. Basically, any tuple (key1, key2) would be added to the end of a tuple (keyX, key1)
    and to the front of a tuple (key2, keyY). 

    Uses recursion to stitch the tuples together like this. Returns the final stitched list.
    '''
    start_is_key2 = [key for key in final_order_list if key[1] == start]
    end_is_key1 = [key for key in final_order_list if key[0] == end]

    if(start_is_key2 == [] and end_is_key1 == []):
    return sub_list

    new_sub_list = []
    if(start_is_key2 != []):
    new_start_tup = start_is_key2[0]
new_start = new_start_tup[0]
new_sub_list.append(new_start)
else:ether(master_repository, slice_map)




if __name__ == '__main__':

    slice_map = get_all_images()

    slice_similarity_control(slice_map)
		images.remove(curr_slice)
		min_sim = 2000000000
		index = 0
		for i in range(len(images)):
			next_slice = images[i]
			x = min(slice_similarity(curr_slice, next_slice), slice_similarity(next_slice, curr_slice))
			if x < min_sim:
				min_sim = x
				index = i
		next_slice = images[index]
		if slice_similarity(curr_slice, next_slice) < slice_similarity(next_slice, curr_slice):	
			images[index] = curr_slice + images[index]
		else:
			images[index] = images[index] + curr_slice



if __name__ == '__main__':
	"""
	Opens file and reads it using a list comprehension into a list called images.
	After reconstructing the image, this method then displays the image and saves
	it to the hard drive.

	
	"""
	IMGS_DIR = 'shredded/destination'
	images = [imageutils.load_image(filename) for filename in imageutils.files_in_directory(IMGS_DIR)]
	reconstruct_image(images)
	imageutils.show_all_images(*images)
	imageutils.save_image(images[0], 'final-destination')
	for p1, p2 in zip(col1, col2):
		sim_score += pixel_sim(p1, p2)
	return sim_score

def pixel_sim(pixel1, pixel2):
	"""
	Helper function that compares two Pixel objects by computing the sum
	of the square of each of the pixel differences, between red, green, blue,
	and alpha. This value is returned and used in column_sim.
	"""
	return sum([(pixel1.red - pixel2.red)**2, (pixel1.green - pixel2.green)**2, 
		(pixel1.blue - pixel2.blue)**2, (pixel1.alpha - pixel2.alpha)**2])

if __name__ == '__main__':
    pass
    dirname = "shredded/grail20/"
    #reads in all the vertical slice image files and put them into a list
    files_list = imageutils.files_in_directory(dirname)
    image_files = [imageutils.load_image(file) for file in files_list]

    #reassembles the list of slices and renders the image
    reassemble_slices(image_files)
    imageutils.show_all_images(*image_files, buffer_width=0)







            simLeft  = compare(piece, elem)
            simRight = compare(elem, piece)

            if simLeft < colLeft:
                left = elem
                colLeft = simLeft

            if simRight < colRight:
                right = elem
                colRight = simRight

        if colLeft < colRight:
            newSlice = combine(left, piece)
            imageutils.save_image(newSlice, left)

        else:
            newSlice = combine(piece, right)
            imageutils.save_image(newSlice, right)

        imageutils.save_image(newSlice, 'shredded\\test\\' + str(100 - len(slices)) + '.png')

    return slices[0]

if __name__ == '__main__':
    slices = []
    for filename in imageutils.files_in_directory(DATA_LOCATION):
        slices += [filename]

    picture = buildPicture(slices)
    imageutils.show_image(imageutils.load_image(picture))
def combine(left, right):
    rightPixels = imageutils.load_image(right)
    leftPixels  = imageutils.load_image(left)
    return rightPixels + leftPixels
예제 #29
0
 def __init__(self, screen):
     self.screen = screen
     self.background = imageutils.load_image("title_screen.png")[0].convert()  
     self.music = os.path.join('data', "music.wav")
def combine_images(image_list, filename):
	imageutils.save_image(combine_arrays([imageutils.load_image(i) for i in image_list]), filename)