| Resources and Support | |
|  Pixel Joint Forum : The Lounge  : Resources and Support | 
|  Topic: Managing color palette with multiple sprites |     | 
| Author | Message | 
| CritiqueMyWork Midshipman     Joined: 12 May 2025 Online Status: Offline Posts: 56 |     Topic: Managing color palette with multiple sprites Posted: 07 September 2016 at 5:30am | 
| 
   Say that you are making the sprites for a game. You split sprites in different files, depending on whether they belong to the same creature/map. To make the game looks consistent, you want to use the same colors across sprites. My question is: - How do you store the palette to reuse it across sprites? - What if you want to change the value of certain sprite, do you make this change by hand for all the affected sprites? | |
|  IP Logged | |
| eishiya Commander     Joined: 04 August 2022 Online Status: Offline Posts: 1109 |     Posted: 07 September 2016 at 7:08am | 
| 
   Many image editors, especially pixel art oriented ones, support saving and importing palette files. The way to do this depends on the program you're using. In Photoshop, if you go to Mode -> Color Table on an indexed image, you can Save and Load a palette there. However, loading a palette just replaces the actual values in order, it doesn't try to match the palette. So, saving the palette works great, but loading the palette only works if the colour order matches, which it often will not. If you want to automatically match the closest colours, you need to re-Index the image. Convert it to RGB, then back to Indexed, and in the dialog box, load your new palette as the Forced custom colours, and set the colour number to the number of colours in that palette. I use PS which doesn't support paletted layers, and I like to keep my layers, so I can't just load a palette when I want to replace colours. So, I do change my colours by hand. Fortunately with pixel art it's pretty simple, I just need to use the Bucket tool with Contiguous set to Off, so that it fills all matching colours with the new colour. It is possible to write a script that does this automatically after being given a new palette, but I haven't gotten around to writing one myself. I usually keep similarly-sized sprites in a single file, both to reduce disk reads in my games, and to make edits like this easier. | |
|  IP Logged | |
| DawnBringer Commander     Joined: 11 August 2024 Online Status: Offline Posts: 568 |     Posted: 07 September 2016 at 7:10am | 
| 
   You use a program that supports indexed palettes. The palette is saved with the image and changing a color in the palette changes the image along with it.
    | |
|  IP Logged | |
| CritiqueMyWork Midshipman     Joined: 12 May 2025 Online Status: Offline Posts: 56 |     Posted: 09 September 2016 at 11:10am | 
| 
   Mmm, indexed palettes is a great idea, i didn't thought about it. I don't use photoshop or the like because they are too complex for me, but maybe i can find the way to automate this. Thanks! | |
|  IP Logged | |
|     | ||
| 
 Forum Jump | You cannot post new topics in this forum You cannot reply to topics in this forum You cannot delete your posts in this forum You cannot edit your posts in this forum You cannot create polls in this forum You cannot vote in polls in this forum | |