Get palette from image without changing the order?

I’ve created a palette in photoshop. The file is 1x256 pixels saved as an index color png. When I load the image, or choose Colors/load palette and select the image, I get the colors, but not in the order they exist in the image. So all my ramps are dispersed randomly throughout the palette. How do I get the colors in the palette to appear in the same order as they are in the image?

Welcome @Boscoe

Please go to the palette editor window. Then go to the area where you can arrange colors etc.:

Hit Ctrl + A or use the right mouse button context menu within the color palette slots to select all colors. Then in the context menu use “Sort/Sort by Appearance”.
This just goes through the image and uses the ordering as colors appear in the image. Repeating colors are skipped.


Awesome! Thank you Jan!