Skip to content

Fix 8-bit sprites PNGs so that they are more upscaler-friendly.

Notifications You must be signed in to change notification settings

DinJerr/spritefix

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

8 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

SpriteFix

A script to help fix 8-bit sprites so that they are more upscale-friendly.

Normally when upscaling these sprites, the transparency bit will be taken into consideration by the upscaling model. This causes some fringe artifacts around the sprite.

8-bit PNGUpscale ResultComment
The green transparency bit produces a green tinge around the sprite.

This script will convert the sprite into 32-bit sprites so that transparency is handled by the alpha-channel, and pads around the sprite with pixels based on the sprite itself.

32-bit PNGUpscale ResultComment
Tinge is removed, and outline colours more consistent with original sprite.

Dependencies

  • Python 3 (Recommend to use Anaconda)
  • Python packages: pip install numpy opencv-python

How to use

  • Put in the sprites into the input folder. OpenCV is only able to read png and jpg files, so if you have gif files, convert them to png first.
  • Run python fixsprite.py
  • Output appears in output folder

To Do list:

  • Check if files are in 8-bit PNG with transparency first, otherwise skip.
  • Add parameter handling so that user can define input and output folders themselves.

Additional Help

  • Take note that not all sprites need to be fixed, and some models may have better output without the padded pixels. Use only if fringe artifacts appear on the upscaled sprite.
  • If you have any questions, we have a discord server where you can ask them and a Wiki with more information.

About

Fix 8-bit sprites PNGs so that they are more upscaler-friendly.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Languages