@withthelove:
You are right, there are different use cases.
I wrote a little tool for changing the palette in an indexed PNG a couple of months ago, since there was no software to be found that was capable of doing that.
-> https://github.com/basxto/loadgpl
Duplicate colors are supported. I sometimes use "subpalettes" in PNGs for different parts of the image, so I can shift them independently.
This tool is obviously not meant for switching to a completly different color palette, but to recolor something within the same palette.
This is nice if you want to create color variations, but also propagate pixel changes you make to the original.
I think one has to distinguish between palettes (DB16) which define all colors that could be used and palettes defined in an image (indexed PNG/BMP), which uses colors from the former, but can have duplicates to easy the automatic generation of color variations.
That feedback was meant for William.Thompsonj, I edited that apparently too late.
I overread your post at first and noticed later that my response could be misunderstood as being addressed at you.
The downloading problem and sorting does not apply to yours. But the magic knob issue does.
Even though those ideas could be implemented in yours too, indeed.
> I'm not sure what you mean by palettes with duplicate colors
In a paletted image each pixel stores the palette index instead of the color. And the palette then is made up of colors, there can be duplicate colors at different indices.
You might not be able to access palettes with JavaScript, at least I wasn't the last time, I tried.
I attached a little bit forced example. It uses a palette of 5 colors. Color #1 and #2 are both black, but #1 is the outline and #2 is the hair color. You can change hair color and outline color independently by changing the color value of those indices.
@williamthompsonj:
Drawbacks: (as far as I can see)
- can't be used in automated work flow with Makefiles etc.
- can't handle palettes with duplicate colors
- automatically sorted palette might be undesirable in certain situations
Feature ideas:
- loading palettes from lowspec
- importing/exporting .gpl (simple text file)
I wasn't able to check whether the swapped image is a paletted png, since the download does not work for me. It's just called `no_image_loaded`
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.
I'd say structs are more type-save. But unions are quite handy when you have different versions of savegame formats (backward compatibilty) and just extend the previous version a bit.
Well 3 colors looks doable. But I'm not sure if I will make something.
I'm more having fun sketching. I could make a second iteration of my breakout game from last summer.
What does that "Look at any existing prototypes you've made and see if you can work with one of them." on itch.io mean? Is it allowed to pick up old jam games? Well not that I'm planning on doing that, it might be better to start from scratch.
If you want something lighter, you must be more specific. Lighter engines are focused on specific genres etc. (flarerpg, solarus, springrts, ren'py...)
I think console export with open source engines might be hard, they are not really open ecosystems?
I think so.
When I parse them I just skip to after the # line and parse the colors with regex '^\s*(\d{1,3})\s+(\d{1,3})\s+(\d{1,3}).*$'
mtPaint generates them like this:
GIMP Palette
Name: gb
Columns: 16
#
15 56 15 Untitled
48 98 48 Untitled
139 172 15 Untitled
155 188 15 Untitled
EDIT:
I don't even skip to #, I just use the regex. But I think I did the skipping in an older shell script.
@withthelove:
You are right, there are different use cases.
I wrote a little tool for changing the palette in an indexed PNG a couple of months ago, since there was no software to be found that was capable of doing that.
-> https://github.com/basxto/loadgpl
Duplicate colors are supported. I sometimes use "subpalettes" in PNGs for different parts of the image, so I can shift them independently.
This tool is obviously not meant for switching to a completly different color palette, but to recolor something within the same palette.
This is nice if you want to create color variations, but also propagate pixel changes you make to the original.
I think one has to distinguish between palettes (DB16) which define all colors that could be used and palettes defined in an image (indexed PNG/BMP), which uses colors from the former, but can have duplicates to easy the automatic generation of color variations.
That feedback was meant for William.Thompsonj, I edited that apparently too late.
I overread your post at first and noticed later that my response could be misunderstood as being addressed at you.
The downloading problem and sorting does not apply to yours. But the magic knob issue does.
Even though those ideas could be implemented in yours too, indeed.
> Do you have any suggestions for palettes that I should add to the library?
Zoria (not on lowspec) https://opengameart.org/content/zoria-tileset
And maybe the original palette of LPC (neither on lowspec) https://lpc.opengameart.org/static/lpc-style-guide/styleguide.html
> I'm not sure what you mean by palettes with duplicate colors
In a paletted image each pixel stores the palette index instead of the color. And the palette then is made up of colors, there can be duplicate colors at different indices.
You might not be able to access palettes with JavaScript, at least I wasn't the last time, I tried.
I attached a little bit forced example. It uses a palette of 5 colors. Color #1 and #2 are both black, but #1 is the outline and #2 is the hair color. You can change hair color and outline color independently by changing the color value of those indices.
EDIT:
Added screenshot for palettes
@williamthompsonj:
Drawbacks: (as far as I can see)
- can't be used in automated work flow with Makefiles etc.
- can't handle palettes with duplicate colors
- automatically sorted palette might be undesirable in certain situations
Feature ideas:
- loading palettes from lowspec
- importing/exporting .gpl (simple text file)
I wasn't able to check whether the swapped image is a paletted png, since the download does not work for me. It's just called `no_image_loaded`
EDIT:
Just remembered this little tool: https://github.com/PureAsbestos/Image-palettizer
EDIT2:
@laborious-rex:
Magic knob does not appear to work on firefox, it just makes the palettes shake.
If it would not touch the image, the pixel's colors would change.
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.
I'd say structs are more type-save. But unions are quite handy when you have different versions of savegame formats (backward compatibilty) and just extend the previous version a bit.
Well 3 colors looks doable. But I'm not sure if I will make something.
I'm more having fun sketching. I could make a second iteration of my breakout game from last summer.
What does that "Look at any existing prototypes you've made and see if you can work with one of them." on itch.io mean? Is it allowed to pick up old jam games? Well not that I'm planning on doing that, it might be better to start from scratch.
If you want something lighter, you must be more specific. Lighter engines are focused on specific genres etc. (flarerpg, solarus, springrts, ren'py...)
I think console export with open source engines might be hard, they are not really open ecosystems?
Well ... you can create more colors by just switching the palette of the screen faster than the eye can handle it.
Pages