Loading
  1. def combineResults(args, thread_count, palette_data):
  2.   thread_id = args[0]
  3.   combine_input_image = args[1]
  4.   x_start = args[2]
  5.   x_end = args[3]
  6.  
  7.   inputs = []
  8.   for thread_a in range(0, thread_count):
  9.     input_thread = outputFolder + 'temp/' + str(combine_input_image[1]) + '_'  + str(thread_a) + "_8bpp.png"
  10.     inputs.append(input_thread)
  11.  
  12.   image_for_resolution = Image.open(inputs[0])
  13.  
  14.   combined_image = Image.new("RGBA", (image_for_resolution.width, image_for_resolution.height), color =(0,0,255,255))
  15.  
  16.   for input_image_path in inputs:
  17.     image_to_add = Image.open(input_image_path)
  18.     combined_image = Image.alpha_composite(combined_image, image_to_add)
  19.  
  20.  
  21.   final_image = Image.new("L", (image_for_resolution.width, image_for_resolution.height), 0)
  22.   final_image.paste(combined_image, box=None, mask=None)
  23.   final_image.putpalette(palette_data)
  24.   final_image.save(outputFolder + str(combine_input_image[1]) + "_8bpp_combined.png")

Comments