-void Image_MipReduce(const qbyte *in, qbyte *out, int *width, int *height, int *depth, int destwidth, int destheight, int destdepth, int bytesperpixel);
-
-// only used by menuplyr coloring
-qbyte *LoadLMPAs8Bit (qbyte *f, int matchwidth, int matchheight);
-
-void Image_HeightmapToNormalmap(const unsigned char *inpixels, unsigned char *outpixels, int width, int height, int clamp, float bumpscale);
-
-typedef struct imageskin_s
-{
- qbyte *basepixels;int basepixels_width;int basepixels_height;
- qbyte *nmappixels;int nmappixels_width;int nmappixels_height;
- qbyte *glowpixels;int glowpixels_width;int glowpixels_height;
- qbyte *glosspixels;int glosspixels_width;int glosspixels_height;
- qbyte *pantspixels;int pantspixels_width;int pantspixels_height;
- qbyte *shirtpixels;int shirtpixels_width;int shirtpixels_height;
- qbyte *maskpixels;int maskpixels_width;int maskpixels_height;
-}
-imageskin_t;
-
-int image_loadskin(imageskin_t *s, char *name);
-void image_freeskin(imageskin_t *s);
+void Image_MipReduce32(const unsigned char *in, unsigned char *out, int *width, int *height, int *depth, int destwidth, int destheight, int destdepth);
+
+void Image_HeightmapToNormalmap_BGRA(const unsigned char *inpixels, unsigned char *outpixels, int width, int height, int clamp, float bumpscale);
+
+// console command to fix the colors of transparent pixels (to prevent weird borders)
+void Image_FixTransparentPixels_f(void);
+extern cvar_t r_fixtrans_auto;
+
+#define Image_LinearFloatFromsRGB(c) (((c) < 11) ? (c) * 0.000302341331f : (float)pow(((c)*(1.0f/256.0f) + 0.055f)*(1.0f/1.0555f), 2.4f))
+
+void Image_MakeLinearColorsFromsRGB(unsigned char *pout, const unsigned char *pin, int numpixels);