07th-mod / umineko-question

93 stars 9 forks source link

Incorrect Gaap Sprites #37

Closed ReitoKanzaki closed 7 years ago

ReitoKanzaki commented 8 years ago

Similar to Krauss and Kanon, the pachinko sprites are used for Gaap's "defa" sprites. screenshot 6

drojf commented 8 years ago

ah so many sprite problems, I think I need to just go through all the sprites and check them

ReitoKanzaki commented 8 years ago

I checked all the folders and am in Episode 4. These were the only instances of incorrect sprites so far. i cannot say for the rest of Episode 4 or if a sprite is missing entirely from the folder.

drojf commented 8 years ago

oh nice, I'll just fix the reported issues then

drojf commented 8 years ago

Because I'm dumb, I thought that all the Gap sprites were pachinko'd, but it's actually only a couple of them. So I made a script to regenerate all the Gap sprites.

Anyway long story short, here are the complete set of sprites, along with a comparison with the original umitweak sprites.

I haven't tested them in game, but the comparison images show that they should be correct. Please try them out. They won't be compatible with the old images because the offset will probably be different, so you should use the whole set of images, not just the ones which are broken.

gap_sprites.zip (put in Umineko\big\bmp\tati\gap\1)

gap sprite comparison.zip


python script:

import csv, os, math
from PIL import Image  #uses the "Pillow" image library

source_folder = r'C:\temp\kan_test\output'
output_folder = r'C:\temp\gap'

umi_project_comparison_path = r'D:\umineko backup\nsadec\bmp\tati\gap\1'
original_comparison_path = r'D:\umineko backup\umineko_backup\bmp\tati\gap\1'
output_comparison_folder = r'C:\temp\gap_comparison'

character_height = 913
output_width = 960
output_height = 960
additional_x_offset = -30

generate_comparison_images = True

with open ('mapping_gap.csv', newline='', encoding='utf-8') as csvfile:
    reader = csv.reader(csvfile, delimiter=',')
    for row in reader:
        output_file_name = row[0].strip()
        images_to_overlay_path = [os.path.join(source_folder, x) for x in row[1:] if x.strip() != '']     #remove empty cells

        print(output_file_name, images_to_overlay_path)

        images = [Image.open(x) for x in images_to_overlay_path]

        overlayed_sprite = images[0]

        if len(images) > 1:
            for im in images[1:]:
                overlayed_sprite = Image.alpha_composite(overlayed_sprite, im)

        #resize character sprite to desired height
        sprite_resized = overlayed_sprite.copy()
        sprite_resized.thumbnail((math.inf, character_height), resample=Image.LANCZOS)

        #resize image and add margin on top side, and optionally left and right side
        if output_width == None:
            temp_output_width = sprite_resized.width
        else:
            temp_output_width = output_width

        output_image = Image.new('RGBA', (temp_output_width, output_height), color=(0,0,0,0))

        #calculate where to paste the resized sprite so that it is located in the middle-bottom of the picture, then paste it in
        x_offset = round((output_image.width - sprite_resized.width) / 2) + additional_x_offset
        y_offset = output_image.height - sprite_resized.height
        output_image.paste(sprite_resized, box=(x_offset, y_offset))

        output_image.save(os.path.join(output_folder, output_file_name))

        if generate_comparison_images:
            umi_project_image = Image.open(os.path.join(umi_project_comparison_path, output_file_name.replace('.png', '.bmp')))
            seventh_expansion_image = Image.open(os.path.join(original_comparison_path, output_file_name))
            seventh_expansion_image.thumbnail((500,500))

            comparison_image = Image.new('RGBA', (output_image.width + umi_project_image.width, output_image.height), color=(0, 0, 0, 0))
            comparison_image.paste(output_image, box=(0,0))
            comparison_image.paste(umi_project_image, box=(output_image.width, 0))
            comparison_image.paste(seventh_expansion_image, box=(output_image.width, umi_project_image.height))

            #comparison_image.thumbnail((1500,1500))
            comparison_image.save(os.path.join(output_comparison_folder, output_file_name))#.replace('.png','.jpg')), quality=85)

Image mapping (open as .csv in excel):

gap_akuwaraia1.png,gap_a11_.png,,
gap_akuwaraia1a.png,gap_a11_悪笑い1A.png,,
gap_akuwaraia2.png,gap_a11_デフォ2.png,mouth_no_teeth.png,
gap_akuwaraia2a.png,gap_a11_デフォ2.png,mouth_no_teeth.png,sweat.png
gap_akuwaraia3.png,gap_a11_悪笑い3.png,,
gap_akuwaraia3a.png,gap_a11_悪笑い3A.png,,
gap_akuwaraia4.png,gap_a11_悪笑い4.png,,
gap_akuwaraia4a.png,gap_a11_悪笑い4A.png,,
gap_akuwaraia5.png,gap_a11_悪笑い5.png,,
gap_aserua1.png,gap_a11_焦る1.png,remove_sweat.png,
gap_aserua1a.png,gap_a12_焦る1.png,,
gap_defa1.png,gap_a11_デフォ1.png,,
gap_defa1a.png,gap_a11_デフォ1A.png,,
gap_defa2.png,gap_a11_デフォ2.png,,
gap_defa2a.png,gap_a11_デフォ2A.png,,
gap_defa3.png,gap_a11_デフォ2.png,mouth_no_teeth.png,
gap_defa3a.png,gap_a11_デフォ2.png,mouth_no_teeth.png,sweat.png
gap_ikaria1.png,gap_a11_怒り1.png,,
gap_ikaria1a.png,gap_a11_怒り1A.png,,
gap_waraia1.png,gap_a11_笑い3.png,mouth_with_teeth.png,
gap_waraia1a.png,gap_a11_笑い3.png,mouth_with_teeth.png,sweat.png
gap_waraia2.png,gap_a11_笑い2.png,,
gap_waraia2a.png,gap_a11_笑い2A.png,,
gap_waraia3.png,gap_a11_笑い3.png,,
gap_waraia3a.png,gap_a11_笑い3A.png,,

gap sweat/mouth overlay images

ReitoKanzaki commented 8 years ago

Thanks. It looks much better now.

drojf commented 7 years ago

Fixed in Patch v2.0