Author Topic: [Tool] Palette Swapping tool  (Read 1517 times)

MetalZelda

  • Hero Member
  • *****
  • Posts: 508
    • View Profile
[Tool] Palette Swapping tool
« on: August 09, 2016, 12:08:49 am »
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
Code: [Select]
'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
« Last Edit: August 17, 2017, 11:34:40 pm by MetalZelda »

Zefk

  • Sr. Member
  • ****
  • Posts: 492
  • Just helping Solarus
    • View Profile
    • Zelzec Business
Re: [Tool] Palette Swapping tool
« Reply #1 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.

MetalZelda

  • Hero Member
  • *****
  • Posts: 508
    • View Profile
Re: [Tool] Palette Swapping tool
« Reply #2 on: August 11, 2016, 09:41:38 pm »
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
« Last Edit: August 11, 2016, 10:24:28 pm by MetalZelda »

Zefk

  • Sr. Member
  • ****
  • Posts: 492
  • Just helping Solarus
    • View Profile
    • Zelzec Business
Re: [Tool] Palette Swapping tool
« Reply #3 on: August 13, 2016, 06:52:26 am »
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/

« Last Edit: August 13, 2016, 06:55:11 am by Zefk »

Zefk

  • Sr. Member
  • ****
  • Posts: 492
  • Just helping Solarus
    • View Profile
    • Zelzec Business
Re: [Tool] Palette Swapping tool
« Reply #4 on: June 14, 2017, 07:07:40 am »
@MetalZelda
The link is down and there is some formatting issue.

Quote
Grab 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]

MetalZelda

  • Hero Member
  • *****
  • Posts: 508
    • View Profile
Re: [Tool] Palette Swapping tool
« Reply #5 on: June 14, 2017, 01:01:40 pm »
I will update the links tonight, I don't have free time this june

Zefk

  • Sr. Member
  • ****
  • Posts: 492
  • Just helping Solarus
    • View Profile
    • Zelzec Business
Re: [Tool] Palette Swapping tool
« Reply #6 on: June 29, 2017, 11:42:02 pm »
The link is still down. Just to let you know in case you forget due to being busy.