YesNoOk
avatar

Applying custom palettes to a bunch of sprites (Read 556 times)

Started by N., December 18, 2024, 06:27:35 am
Share this topic:

N.

Applying custom palettes to a bunch of sprites
New #1  December 18, 2024, 06:27:35 am
  • avatar
  • ***
I don't know how useful any of this will be, but here's a way for you to make custom palettes and then apply them to your sprites.  I don't know if it's a good way, but it's a way, nonetheless.


What you'll need (Note: I haven't looked for anything newer that can do these):

Jasc PaintShop Pro 8  Or an image editor that lets you open palette files in a text editor, use nearest color matching when loading palettes, and can batch apply palettes to multiple images.

.......That might be ok to post, since you can't buy it anymore, it's an outdated version, and you don't have to find a crack or serial number for it (they said it might be a gift cd.  I could be wrong, but 7.0 didn't require it, but 8.0 did when it became Corel PaintShop Pro.  Nonetheless, this is an obsolete/inferior version).


GlueIT

Stitches images together into one.


(optional): Notepad++

I don't know if you have a text editor that shows you what line you're on, but this makes it easier for you to see whether or not you went over/under 256 color entries when doing custom palettes.


The first thing you'll do is:

- Use GlueIT to combine all of your images into one (Click Add, select all of your images, click GlueIT, and then click Save).  The spritesheet should only contain character sprites.  Then you do ones for effects and whatever else you're going to add (to make it easier for you to move things around).



- Open that image in PSP and decrease it to 256 colors  (Image/Decrease Color Depth/256 colors (8 bit), then check Optimized Octree for Palette and Nearest Color for Reduction and click OK).  Click ok if it tells you you have to flatten it down to a single background layer.



- Save the palette as a PspPalette file (Image/Palette/Save Palette.  AFAIK, you can't open .pal files in a text editor).


- Find the directory the palette is saved at (unless you specified someplace else for it.  It's normally at C:\Users\username\Documents\My PSP8 Files\Palettes), and open the PspPalette in a text editor.


- If you're not adding any new colors to the palette and just want to reorganize them however you want, you can use cut/paste or just highlight the color entry and click-drag it, and save those changes. 
If you want to add colors from another sheet, you copy the contents of the PspPalette (your final palette list) to a text editor, save the palette(s) for whatever you want to add, and copy those to a text editor, make note of how many lines whatever you want to add takes up, and then replace that amount of lines in your final palette list.  Then you copy/paste that into the PspPalette file and save it.
THIS IS IMPORTANT: The PspPalette file should contain 256 color entries, plus the 3 lines of info above them.  It'll mess up if you go under/over.



- Do a test run with it by loading it to your GlueIT image (Image/Palette/Load Palette, check Nearest color matching).  If done correctly, there will be no significant change in colors.


- Now, to apply this palette to all of your images, you'll want to make a script and then apply it to all of the images.
 


-  First you load an image to apply the palette to, then go to File/Script/Start Recording, load the palette to the image, then go to File/Script/Save Recording, and then click out of Scripts-Restricted and go to Scripts-Trusted and save the script there.



- And then, go to File/Batch/Process, load the script by clicking the browse button, set save mode to New Type, set the type to Windows or OS/2 Bitmap (I tend to run into issues whenever I try to save them as PNGs, but that's just me), select what images you want this palette to be applied to (shift-click, or ctrl-click, or shift+ctrl-click in the save window), and set the folder to anywhere but the folder your images actually are in.
And that should batch apply your custom palette to all of the selected images.
1 Last Updated: 4/19/23
2 Last Updated: 1/16/21
3 Last Updated: 04/20/23
4 Last Updated: 7/16/17
Last Edit: December 18, 2024, 07:01:43 am by N.