-
Notifications
You must be signed in to change notification settings - Fork 27
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
minor graphical issue when extract assets. #304
Comments
Interesting. Is this observed in the png itself or after loading extracted assets back into the game? Would be good to isolate if this is from the DDS to png conversion or if it's happen on Playlunky when being converted back for loading into the game. |
Thoughts from Discord:
Solutions:
I tried to undo the premultiplication and then load the textures again in PL https://imgur.com/a/Z4ToeAS def dds_to_png(data):
"""Takes a .DDS `Image` and returns .png data."""
img = Image.open(io.BytesIO(data))
px = img.load()
width, height = img.size
for i in range(width):
for j in range(height):
if px[i, j][3] != 0:
R = int(255.0 * px[i, j][0] / px[i, j][3] + 0.5)
G = int(255.0 * px[i, j][1] / px[i, j][3] + 0.5)
B = int(255.0 * px[i, j][2] / px[i, j][3] + 0.5)
a = px[i, j][3]
px[i, j] = (R, G, B, a)
new_data = io.BytesIO()
img.save(new_data, format="PNG")
return new_data.getvalue() |
When extracting assets with modlunky, there seems to be a problem with the sprites being slightly deformed.
Translucent parts(especially glowing effect) on a extracted image turns black.
This can be clearly seen at Arrow of light, jellyfish, orb, etc.
The text was updated successfully, but these errors were encountered: