November 2, 2021, 9:22pm
The original Portrait formatter is somewhat inconvenient to use so I made this.
run this in a folder to create a nice and clean event that loads all portraits in the folder.
The code will detect mouth/eye position for you.
requires definitions of FileName+Mug
e.g. Eirika.png =>
#define EirikaMug something
This file has been truncated.
from PIL import Image
READ_AHEAD_BUFFER_SIZE = 0x00000012
SLIDING_WINDOW_SIZE = 0x00001000
def b(v: int):
return v.to_bytes(1, "little")
def length_of_match(data, x, y):
"""Calculates the number of consecutive characters that are the same starting at x and y in data."""
for c in range(READ_AHEAD_BUFFER_SIZE):
if (y + c) >= len(data):
if data[x + c] != data[y + c]:
also part of pyEA,
Requires numpy, PIL and optionally fastgbalz77
if someone wants to make a windows binary or an EA tool out of this, please do.
November 18, 2021, 11:49pm
Pushed a fix but untested.
Will get back to you if the fix didn’t work.
November 19, 2021, 12:27am
Thanks, seems to work
Okay, so it doesn’t seem to insert correctly:
It gave me a completely black palette to use. I pasted in the palette from inserting it normally.
Looks like the image part is working, though.
November 19, 2021, 8:21pm
Idk it seems correct on my end.
Can you link the portrait?
November 19, 2021, 8:59pm
Your image was not indexed and the script didn’t account for an alpha channel. Should be fixed by now.
November 19, 2021, 9:05pm
Ok, thank you!
I got it from Mystic’s easy buildfile… don’t look at me
November 20, 2021, 12:53am
i got it from the VBA buildfile
don’t look at me
November 20, 2021, 1:28am
@circleseverywhere stole the cookie from the cookie jar!
November 22, 2021, 4:34pm
Still getting the same issue. The script works but gives me a black palette.
But for this one where I reduced Roshea.png to 4bpp it crashes the script.
I also tried installing fastgbalz77 and compiling your code into an .exe for use in a buildfile. Not really sure if I compiled it including the fastgbalz77 or not, as I have no idea what I’m really doing lol. I was wondering if it can be ran from a separate folder. That way, it could be in EventAssembler/Tools instead of with the graphics themselves. It might also be nice to have it send data into a “dmp” folder for the sake of organization.