Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Customize "emerald_version.png" - Is there a tile file? #2058

Open
manuman94 opened this issue Oct 30, 2024 · 5 comments
Open

Customize "emerald_version.png" - Is there a tile file? #2058

manuman94 opened this issue Oct 30, 2024 · 5 comments

Comments

@manuman94
Copy link

Hey there! I'm just starting with this rom hacking and I was trying to modify the title screen images.

  • For the pokemon logo I just modified the PNG and worked out of the box
  • For the background I used Tilemap Studio importing the rayquaza.bin tilemap and I saw how could I do it with a custom PNG.
  • But for the "emerald_version.png" and the press start I'm not sure how to do it because I can't find the proper settings for Tilemap Studio and as there is no ".bin" file I can't take it as an example. I know that if I modify the PNGs is enough, but they are disordered in a tilemap form so it's very hard to design something that way.

Is there any easy way to design those two?

Thanks in advance!

@ketsuban
Copy link
Contributor

The version, press-start and copyright banners are implemented with sprites rather than tilemap information, so there's no "tile file" as you put it. This is the relevant data to understand; the version banner is created in Task_TitleScreenPhase1, and the press-start and copyright banners are created by functions (CreatePressStartBanner and CreateCopyrightBanner) called in Task_TitleScreenPhase2.

@manuman94
Copy link
Author

Thanks for your quick response!

So, let me reformulate the question.

Is there any way of editing it in an easier way than having to split the title and some trial and error to make it fit perfectly?

If not, I will try to create some python script to get the title in the required format from a normal png.

Again thanks for the support.

@manuman94
Copy link
Author

manuman94 commented Oct 30, 2024

I made this simple script that turns the first image (128px x 32px) into the second (64px x 64px, required by the game):

emerald_version
emerald_version - desired

The convertEmeraldVersionImage.py script:

import sys
from PIL import Image

def convert_image_to_pokeemerald_format(input_path, output_path='output.png'):
    original_img = Image.open(input_path)
    
    if original_img.size != (128, 32):
        raise ValueError("The input image must be 128px wide by 32px tall.")
    if original_img.mode != 'P':
        raise ValueError("The input image must be in indexed color mode ('P' mode).")
    
    new_img = Image.new('P', (64, 64))
    new_img.putpalette(original_img.getpalette())
    
    left_half = original_img.crop((0, 0, 64, 32))
    new_img.paste(left_half, (0, 0))
    
    right_half = original_img.crop((64, 0, 128, 32))
    new_img.paste(right_half, (0, 32))
    
    new_img.save(output_path)
    print(f"Image saved as {output_path}")

if __name__ == "__main__":
    if len(sys.argv) < 2:
        print("Usage: python convertEmeraldVersionImage.py <input_image> [output_image]")
        sys.exit(1)
    
    input_path = sys.argv[1]
    output_path = sys.argv[2] if len(sys.argv) > 2 else 'output.png'
    
    try:
        convert_image_to_pokeemerald_format(input_path, output_path)
    except Exception as e:
        print(f"Error: {e}")

Don't forget to install the Pillow library to handle images pip install pillow

@mrgriffin
Copy link
Collaborator

Huh. I wonder if it would be possible to use -mwidth & -mheight to let emerald_version.png be a 128x32 image rather than a 64x64.

@GriffinRichards
Copy link
Member

Huh. I wonder if it would be possible to use -mwidth & -mheight to let emerald_version.png be a 128x32 image rather than a 64x64.

It would be

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants