Language…
22 users online: akawo, Alex No,  AmperSam, CharlieUltra, CroNo, DanMario24YT, Fullcannon, Gemini0, Golden Yoshi, Gulaschko, Hammerer, Heitor Porfirio, kurtistrydiz,  MarioFanGamer, MarkVD100, Maw, Metal-Yoshi94, mtheordinarygamer, NewPointless, Spedinja, steelsburg, superbot12 - Guests: 267 - Bots: 338
Users: 64,795 (2,370 active)
Latest user: mathew

[Tool, Beta] Generate palette files from Lunar Magic screenshots!

This is a little something I made for personal use and figured I'd polish up and release.

PalGenerator.exe


sample screenshotsample output


And no, this won't generate you pals. What it does do, however, is this: give it a screenshot from Lunar Magic's palette editor, and it'll generate a .pal file, ready to be imported back into LM or whatever other tool supports the format.

This may or may not be useful for people who - like me - frequently edit palettes in image editors by applying filters and color adjustments to screenshots of the palette editor. Copying the edited colors back into LM is a major pain in the ass, so I wrote this tool to automate it.

To use it, you can either:
  • run it from the command line: PalGenerator.exe <image>
  • open the program and provide the image path (or drag-'n'-drop the image on top of the program window when prompted)
  • drag-'n'-drop the image on top of the program icon
The output is a .pal file in the same directory as the original image.

Disclaimer: the tool may not always work yet! (That's why I'm not officially uploading it for the time being.) If you get wrong results, please post the image you're using and the .pal file you get! That'd help lots.

I wrote this tool in C++ using the Allegro library (overkill for this task because all I need is "get color at pixel", but I couldn't wrap my head around any of the image manipulation libraries I found). Also thanks to Alcaro for libcon!




That said, have fun with the tool! (And as I mentioned, let me know if something breaks!)

 


 
Wow I used to just write down the numbers on a random piece of paper and copy them (sometimes I accidentally mess up palettes and have to redo a lot). Thanks!
Neat
--------------------
PM | Steam | YouTube
Oh hey. Neat. Never thought of it, but it's one of those things that now it's created I'd probably start using even though I never needed it before. Nice/
can you add a feature to generate a 3 tables from a palette:

color:
db
LowByte:
db
HighByte:
db

because usually when i try to make palette change i need to transform colors to hexa and is annoying and slow.

------------------------------------------------------

Youtube
Twitter
SMWControlLibX GitHub
My Discord Server
Snestorage where you can download my resources
Originally posted by Frost
Oh hey. Neat. Never thought of it, but it's one of those things that now it's created I'd probably start using even though I never needed it before. Nice/


Sums up my thoughts on this tool pretty well, I'd think. Can't really romhack at the moment with it being too much of a hassle, but when I eventually get back into it this will certainly come in handy. Good work, WYE!
Thanks everyone! #tb{:)}

Originally posted by anonimzwx
can you add a feature to generate a 3 tables from a palette:

color:
db
LowByte:
db
HighByte:
db

because usually when i try to make palette change i need to transform colors to hexa and is annoying and slow.

Sure thing, although such a niche feature would probably be better off as a separate tool. How about something like this? It's very quickly thrown together, but it does the job I think you want it to do. (source)


 
Originally posted by WhiteYoshiEgg
Thanks everyone! #tb{:)}

Originally posted by anonimzwx
can you add a feature to generate a 3 tables from a palette:

color:
db
LowByte:
db
HighByte:
db

because usually when i try to make palette change i need to transform colors to hexa and is annoying and slow.

Sure thing, although such a niche feature would probably be better off as a separate tool. How about something like this? It's very quickly thrown together, but it does the job I think you want it to do. (source)



Oh thanks WIE

------------------------------------------------------

Youtube
Twitter
SMWControlLibX GitHub
My Discord Server
Snestorage where you can download my resources
Why do I need to remove the window border to generate a palette? I tried this and didn't work (palette), but this worked.
Originally posted by Erik557
Why do I need to remove the window border to generate a palette? I tried this and didn't work (palette), but this worked.

You shouldn't need to, ideally - it means I screwed up somewhere. (I was sure that was gonna happen.)

Thanks a lot for actually trying it out and providing a testcase! #tb{:)} I'll look into that. Keep an eye on this thread.


 
Alright, found the problem!

I need the program to find out where in the image the palette data starts, and the way I did it is "if two 16-pixel diagonals from that point are of a single color respectively, that must be where the palette starts". Turns out two aren't enough though (the window title bar is a single color too), so I decided to check for the full sixteen diagonals instead.

Anyway, long story short, the bug you reported is fixed. #tb{:)} Thanks again for letting me know! Feel free to redownload (same URL).