I'm not sure how many colors this shaders actually supports or what are the grayscale colors it assigns to to each color position...
There are many other shaders like this, some can have up to 256 colors...
You'll have to try yourself and figure it out, for example, you might find what are the the grayscale values by seeing what's the distance between one RGB value and another on the example sprites.
This will also give you a pretty good idea of how many colors you can have. I'll await for you to figure if you can use this shader before adding the flip, cause you might need to switch to another shader.

Clickteam Fusion 2.5 - Palette Swap Shader Finished 5/21/2021
Welcome to our brand new Clickteam Community Hub! We hope you will enjoy using the new features, which we will be further expanding in the coming months.
A few features including Passport are unavailable initially whilst we monitor stability of the new platform, we hope to bring these online very soon. Small issues will crop up following the import from our old system, including some message formatting, translation accuracy and other things.
Thank you for your patience whilst we've worked on this and we look forward to more exciting community developments soon!
Clickteam.
A few features including Passport are unavailable initially whilst we monitor stability of the new platform, we hope to bring these online very soon. Small issues will crop up following the import from our old system, including some message formatting, translation accuracy and other things.
Thank you for your patience whilst we've worked on this and we look forward to more exciting community developments soon!
Clickteam.
-
-
I have not yet figured out how to associate the colors of grayscale with normal color map hmm
If you mean what I think you mean, you will need a decent graphics app (ie. not Fusion). It's essential that all of your sprites use the same palette, with colours in the same order, or you will never get anywhere - if there's not the case, you need to find some new sprites that will work.
Then you just need to use another palette where each entry has RGB components equal to the palette entry (ie. 0=R0,G0,B0; 1=R1,G1,B1... 255=R255,G255,B255), and then apply that palette to your sprite. Here's a palette file I made quickly: Please login to see this link.
I use Paint Shop Pro, but I expect free alternatives like GIMP will probably work too.
Here you can see the original palette in the top corner, and the greyscale palette that we want to apply - note that we're maintaining the original palette indexes (not mapping to the nearest colour in the palette).
Please login to see this picture.And the end result looks like this:
Please login to see this picture.And then just make sure that when you save the new image, your graphics app doesn't try to optimize the palette or anything like that.
In a more powerful app like Paint Shop Pro, you could even create a script to batch-process all of your sprite images in one go. -
Well, here is the result, many colors are lost, it is clear that the method does not suit me. I don't understand why something as simple as changing a palette is the holy grail of ClickTeam. A huge amount of memory is wasted on FLIP and different palettes. Geez
Please login to see this attachment.
-
Zoom
Please login to see this attachment.
-
Indexed colour on modern systems is actually not that straightforward, as everything's designed around true colour these days.
Having said that, I made a shader years ago that will do what you need: Please login to see this link.
The only catch is that it hasn't been ported to DX11.
Here's the palette for your sprite, in case you want to test it: Please login to see this picture. -
Done. I've ported it to DX11:
Please login to see this link. -
It's proving tricky to port to DX11, but I've combined a few of my older shaders into a kind of all-in-one 8-bit sprite shader:
Please login to see this picture.
- palette swapping
- flip / mirror / rotate 90 degrees
- alpha dithering -
That's awesome, MuddyMole!
It's nice since we can't normally stack effects.
Let me know if you need help porting, you probably better than me but I learned a lot of tricks since I started messing with shaders. -
That's awesome, MuddyMole!
It's nice since we can't normally stack effects.
Let me know if you need help porting, you probably better than me but I learned a lot of tricks since I started messing with shaders.Thanks. I'm not having much success...
Please login to see this link.
-
It's proving tricky to port to DX11, but I've combined a few of my older shaders into a kind of all-in-one 8-bit sprite shader:
Please login to see this picture.
- palette swapping
- flip / mirror / rotate 90 degrees
- alpha ditheringWow! You are a true hero MuddyMole!
-
Thanks. I'm not having much success...
Please login to see this link.
I really hope for a port under directX11. MuddyMole, can you please describe step by step how to make palettes for other characters like you did and how to add alternative ones? I tried to convert the image to grayscale, but I got a loss of colors. Sorry i'm a bit of a noob at shaders.
-
As I say, all of this requires a decent image editor, so if it's not working, most likely that's your problem.
The first file I linked to includes a little "Palette Exporter" tool that I made. If you load a .gif file, it will will automatically generate the two .bmp image files that you need (the greyscale sprite and the palette) - Please login to see this link.
Since you have a .png file, you will need to convert it to a .gif file (.png files would have been too hard to read, as they come in a lot of different "flavours" and use a complicated form of compression).
Also, I've noticed that my tool doesn't like pure black (RGB:0,0,0), so replace that with almost pure black first (eg. RGB:1,1,1).The easiest way to create additional alternate palettes for your characters, is to copy and paste the palette image inside the character sprite. Then you can use the usual filters (brightness, contrast, hue, saturation, etc) to edit the image, and when you're done, just cut out the palette from the image and save it.
Please login to see this picture.
To make blue transparent, you can either open the palette image, replace blue with transparent, and then resave as a .png file (which supports transparency), or do the same from within Fusion's image editor.
The problem you're going to have with these sprites is that they weren't intended to be palette-swapped. You can see that the character's red belt uses many of the same shades of brown as his skin - which means that you can't change one without it affecting the other (give him a green belt, and his skin will turn green too!). It's the same with his shorts - you can't make them a different colour without changing his hair and shoes at the same time. It is possible for multiple palette entries to be identical, which would get around that problem, but your sprite doesn't do that.
-
thanks, let's say I have an alternative palette ready for the character, but you can only upload one, how can I have two in the program and switch?
Please login to see this picture.
Please login to see this picture. Please login to see this picture. Please login to see this picture. Please login to see this picture. Please login to see this picture. Please login to see this picture.
-
Save it as an external image file, and then load it at runtime as an image parameter.
-
That's awesome, MuddyMole!
It's nice since we can't normally stack effects.
Let me know if you need help porting, you probably better than me but I learned a lot of tricks since I started messing with shaders.NaitorStudios Can you please try to make a port under direct 11?
-
Okay, it's done. I'm sure there's room for improvement, but it seems to work now.
Download: Please login to see this link.
-
Okay, it's done. I'm sure there's room for improvement, but it seems to work now.
Download: Please login to see this link.
Wow, no words :O, thank you so much.
-
MuddyMole Kage I've already know how to fix Alpha Dither since I did ported it to DX11 before.
After porting it, I found a user who also did a port as well but that was slightly broken so I shared mine.Also, I suggest adding a parameter that completely fills the sprite with one solid color to this new shader.
I could have the dither but I don't think old school games could do this, either they would completely fill it with a color or change the palette.
Technically alpha can be used when setting color through a workaround, so no need to a separated parameter. -
Oh, I was working on that and didn't saw you got it to work lol
Just a tip: In this specific scenario, I don't know why, but you don't need the ps_main_pm or premultiplied version.
To fix the white dithering on premultiplied you just need to multiply rgb by alpha at the end on ps_main, it will work for both -
MuddyMole Kage I've already know how to fix Alpha Dither since I did ported it to DX11 before.
After porting it, I found a user who also did a port as well but that was slightly broken so I shared mine.Also, I suggest adding a parameter that completely fills the sprite with one solid color to this new shader.
I could have the dither but I don't think old school games could do this, either they would completely fill it with a color or change the palette.
Technically alpha can be used when setting color through a workaround, so no need to a separated parameter.thanks, now that elusive palette changing feature is finally achievable
-
Participate now!
Don’t have an account yet? Register yourself now and be a part of our community!