[Tool] Palette Swapping tool

Started by MetalZelda, August 09, 2016, 12:08:49 AM

Previous topic - Next topic
August 09, 2016, 12:08:49 AM Last Edit: August 17, 2017, 11:34:40 PM by MetalZelda
Author: MaximusMaxy
Taken From: Project Zelda Engine

Updated link

Grab this tool here.
https://www.mediafire.com/file/f7iz2t8e4iv21cx/tool.zip

This tool will ease your life, especially for those who re-use some material with another color (the hero for example), this will make your job.

What you need:
[/b][/i][/u]
  - Script editing software (Notepad ++ is largely enough)
      If you don't have any software grab Notepad++ here -> https://notepad-plus-plus.org/
  - Image editing software (for your sprites, mostly, and for the required files)
      Don't have any ? Grab GIMP, it's free and it does the job ->https://www.gimp.org/


I am gonna do this tutorial with my sprites.


How this work :


Step 1: The Basic
1 - Dowload the archive
2 - Extract it somewhere
3 - Go to Data/scripts and open this script in your favorite script editing program

Step 2: It starts.
4 - Select the sprites you want to convert and place them in Graphics/characters
 


5 - Open your image editing software and grab a sample of your sprite. Create a new image with as parameter
  Width = the number of pixel you want to convert
  Height = 1 (You can set any value you want)
 

6 - Grab the colors you want to modify like so, in my example, I want to recolor Link's Tunic to red


Save this as png in Graphics/Characters, and name it StartColor.png, this file will be used by the script to memorize the color to change.

7 - Set your target colors, like so


Save this file as png in Graphics/Characters, and name it TargetColor.png, this file will be used by the script to replace the memorized color by StartColor.

8 - Go to the script editor, and go to the previously opened script, and go at line 43, you will see something like this


Replace all the things in '' by the sprite you want to convert, without it's extention like so
'your_file',

9 - Save the file

10 - Open the programm


11 - The process is completely automated, the speed of the conversion may vary from your CPU, hard drive speed, etc


12 - When finished, the programm warns you, and close automatically


13 - Go to the 'Palette Swap' folder.


Ta-da

This script is kinda useful, you don't need to swap color manually from a image editing software, so it save a lot of time.
Have fun

I tried the script and thought it was neat. Thanks for posting it. I will add a link to this post to the Solarus Help Guide project.

August 11, 2016, 09:41:38 PM #2 Last Edit: August 11, 2016, 10:24:28 PM by MetalZelda
Quote from: Zefk on August 11, 2016, 01:36:31 AM
I tried the script and thought it was neat. Thanks for posting it. I will add a link to this post to the Solarus Help Guide project.

Thread updated, added images

August 13, 2016, 06:52:26 AM #3 Last Edit: August 13, 2016, 06:55:11 AM by Zefk
Your instruction guide has improved drastically. Excellent work!  :D

I would like to mention that Krita has superior Photoshop like layers now. Gimp is not the only free alternative out there for Microsoft Windows and Linux. Sadly, no 32bit Linux version for Krita 3.0, but the Windows 32bit version runs through PlayOnLinux on my computers.
https://krita.org/en/download/krita-desktop/


@MetalZelda
The link is down and there is some formatting issue.

QuoteGrab this tool here.
http://www.filedropper.com/paletteswap

This tool will ease your life, especially for those who re-use some material with another color (the hero for example), this will make your job.

What you need:
[/b][/i][/u]

I will update the links tonight, I don't have free time this june