This is a problem that has been bugging me for a while, and now I face the same problem again.
When converting old paper documents to electronic form with good quality, there's a series of stages:
1. Scan at hi-res, gray-scale or color.
2. Perform fix-ups of each page in photoshop (B&W saturation, deskew, align to uniform page borders, despeck, etc.)
3. Scale down to final size (still in RGB24.)
4. Apply optimum image compression to all pages. ie reduce bits per pixel.
5. Encapsulate page images in whatever form suits. (I tend to use RAR-book with html doc structure, rather than PDF.)

I use Irfanview for stages 1, 3 & 4.
But there is one problem. Typically for B&W text I compress the final images in PNG 16 color ie 4 bits per pixel, since this preserves enough edge shading on characters to avoid jaggies. Sometimes printed pages may have another ink color, with both solid and flat screened areas. This means at least two of the color table entries need to be 'other than gray scale'. That's OK, easily sorted with single images.

But, for multi-page documents (ie almost always) its very desirable for all page images to use identical color tables. Otherwise there can be variation in appearance from page to page. So where even one page has a 2nd ink color, all pages should use the color table adapted to that one page.

But how to make Irfanview use a uniform color table when doing batch multi-file compression to PNG-16 or 256?

It would also be good to be able to generate and save a color table (say from a specific page image) then manually ensure it contains pure white and black plus any other special colors needed, then instruct Irfanview to use that color table when doing batch compression of many images.