Added templated compress (for anything with pixels)