tpt++/mniip:  shouldn't use PIXR/G/B/PACK there, would break if using a non-standard bit scheme

Also make sure std::max works everywhere, even in visual studio