Skip to main content

User login

What is OpenID?
  • Log in using OpenID
  • Cancel OpenID login
  • Create new account
  • Request new password
Register
  • Home
  • Browse
    • 2D Art
    • 3D Art
    • Concept Art
    • Textures
    • Music
    • Sound Effects
    • Documents
    • Featured Tutorials
  • Submit Art
  • Collect
    • My Collections
    • Art Collections
  • Forums
  • FAQ
  • Leaderboards
    • All Time
      • Total Points
      • Comments
      • Favorites (All)
      • Favorites (2D)
      • Favorites (3D)
      • Favorites (Concept Art)
      • Favorites (Music)
      • Favorites (Sound)
      • Favorites (Textures)
    • Weekly
      • Total Points
      • Comments
      • Favorites (All)
      • Favorites (2D)
      • Favorites (3D)
      • Favorites (Concept Art)
      • Favorites (Music)
      • Favorites (Sound)
      • Favorites (Textures)
  • ❤ Donate
General Discussion

Tool or script to reorder colors in palette

Mc7r
Sunday, May 24, 2020 - 10:14

Hi. I often come at the case when I need to do this. When I have a sprite with a background let's say this sprite, where the wood is the item and the magenta is the BG color. As can be seen on the palette the magenta is 13th color on the top.

For some game engines I need this color to be first.(in some game engines and tools it may also appear as last color e.g bottom right corner).

With a bit of help I created a python script to batch process many images. So I can make the first color (now orange) go to index 13 and Magenta go to first.

In a tool where I use it one by one it may seem I change order because as in the image if I just swap colors, the background becomes too close color to the rest. It can be black or the wood colors in this case.

So it is not color swap that I need? Is there an reorder way>?

it can be a script or a tool, looking for anything, Irfan view just cant do that.

Attachments: 
Preview
0palswaps.jpg 0palswaps.jpg 284.4 Kb [1 download(s)]
  • Log in or register to post comments
Baŝto
joined 9 years 9 months ago
Monday, May 25, 2020 - 13:17
Baŝto's picture

Well, changing the palette is not enough, you also have to adapt the indices of the pixels.
mtPaint is capable of changing the order, when you press shift and drag a color in the palette.
Grafx2 allows to swap two colors in the palette with or without also changing the pixels.

  • Log in or register to post comments
Mc7r
joined 1 year 11 months ago
Monday, May 25, 2020 - 14:53

I just realized what im doing wrong.. If I swapped color values within palette then magenta would be black (if thats 1st color) and black would be magenta, so that affects the image and it becomes a mess.. like all my dark places using the black become magenta.

GIMP has the rearrange color map, where you drag the color you need first and it doesnt touch the image itself. Good I don't need extra tools or the ones you suggested but didnt know GIMP has that. Now I will only look if a script can do this as batch process,

  • Log in or register to post comments
Baŝto
joined 9 years 9 months ago
Monday, May 25, 2020 - 20:47
Baŝto's picture

If it would not touch the image, the pixel's colors would change.

  • Log in or register to post comments