I had one, for medanfen vram dumps (and palette block dumps), not sure where the source is now. Should be trivial to write one up though (BMP format is so easy, you don't even need a lib for it).
Yep, the basic print-to-bitmap for both the sprites and the backgrounds was only a couple of pages of code (and I like to use lots of white-space).
Both BMP and PCX are pretty simple to write ... but my BMP writer is somewhat complicated by handling both 24bpp and 32bpp as well as 8bpp (for historical reasons).
The only thing I caution, is when you parse the palette block and create a 256 palette picture, is use an embedding scheme for the subpalettes.
Now this is a really clever idea!
Are you storing the original palette index in those bottom bits, or a palette number, or the repeat-count of the particular RGB value?
With the 1st, you can reconstruct the original palette order from just the bitmap file, but with the other 2, you still need access to the original palette in order to fix a mis-ordered palette.
But I'm just not sure how much help it's going to be to an artist if they're doing any reasonable editing on the file.
If they're using something like Photoshop that has lousy palette handling, isn't it going to re-order the palettes on load/save and make it almost-impossible for the artist to actually edit the bitmap and keep to within a single palette in an 8x8 tile anyway?
Isn't the better "solution" just to get the artist to use an editing program that doesn't f**k up the bitmap's palette ordering (like "grafx" or "ProMotion")?
Are there some particular image-editing scenarios that I'm missing here?
OTOH ... if this really is a major benefit in practical use, then it sounds like it should be a separate utility that can be run at any time to either "fix" or "protect" a bitmap's palette by checking or creating these guard-bits.
****************
BTW ... the last time that I was working on a game that used tilemaps, we didn't use a map-editor like Mappy, we just did everything on a large bitmap in a bitmap editor.
Then the bitmap would get carved up into tiles by my converter program.
Pretty much like Mappy's "Create Map From Big Picture", or what ProMotion allows you to do (but theirs is much, much better).