Users browsing this thread: 4 Guest(s)
Sprite Limitations for SNES and GBA
#9
If you're planning on converting a screenshot to the SNES palette, it's going to make very little difference. Unless you're working with very smooth gradients, the conversion will be unnoticeable. With that being said, here's a python script that'll handle the conversion for you:

Code:
from PIL import Image
import sys
import os

filename = None
picture = None

while True:
   try:
       filename = input("Enter a filename: ")
       picture = Image.open(filename)
   except FileNotFoundError:
       print("File ", filename, " not found!", sep='\"')
       continue
   break
   
width, height = picture.size
pic = picture.load()

for x in range(width):
   for y in range(height):
       color = pic[x,y]
       tempcolor = [x - (x % 8) for x in color] # Where the magic happens
       tempcolor[3] = 255 # Alpha is always 255
       newcolor = tuple(tempcolor)
       pic[x,y] = newcolor
       
filename = os.path.splitext(filename)[0] + "_converted.png"
picture.save(filename)
print("Saved converted image to", filename)

EDIT:
Just spent half an hour trying to bake this into an .exe but Python is a stubborn beast. If you can't run python scripts then SOL. ¯\_(ツ)_/¯
Reply
Thanked by: Midday-Mew


Messages In This Thread
RE: Sprite Limitations for SNES and GBA - by Koh - 04-05-2016, 02:29 PM
RE: Sprite Limitations for SNES and GBA - by Pik - 04-21-2021, 10:55 PM
RE: Sprite Limitations for SNES and GBA - by DragonDePlatino - 10-16-2016, 11:18 AM

Forum Jump: