JPEG & GIF Texture Support

Is LUA capable of adding texture support for .jpg and .gif?

This is desperately needed for the following reasons:

.VTF is just a rewrapped .tga file, which is a bloated, uncompressed format. It’s only redeeming qualities are being lossless and having an alpha channel.

Valve uses the .VTF format because it’s 1st party multiplayer games don’t rely as heavily on custom file distribution as does Garry’s Mod. Valve rightfully has no reason to support anything other than lossless textures, for maximum quality.

However, just about every non-sandbox server has anywhere from 10-100 MB in custom files that it must be sent to every client. I’d even wager that custom content is the main reason anyone even plays Gmod. The reasons Valve exclusively uses .VTF textures in Source does not apply to Garry’s Mod whatsoever.

A few in depth examples:
When I make a 2048x2048 base texture that needs to have supporting reflection and illumination textures, I end up with the following files.

Screens1.VTF - - - - - - - - - 2048KB
Screens1 - Glow.VTF - - - -2048KB
Screens1 - Reflect.VTF - - 2048KB

6.14 MB for a basetexture and a couple of GREYSCALE images? That is completely unnecessary. What if the basetexture could be jpg, & the 2 grayscale images could be 8 bit .GIF?
Here what if. (Its a bunch of screens and panels with varying intensity)

Screens1.jpg - - - - - - - - - - - - 453 KB (5/10 Quality in Photoshop)
Screens1 - Glow.gif - - - - - - 32.5 KB
Screens1 - Reflect.gif - - - - - 32.5 KB

Obviously the main savings come from the greyscales, but your still shaving 75% off the basetexture sizes with hardly any noticable quality loss - especially when applied to a model. Also, any decent model is going to have such supporting textures, not to mention detail maps, bumpmaps, etc.

If this were possible, maps, models, & NPCs transfers would complete several times faster on average. This would reduce the bandwidth costs of just about everyone. Servers, Clients, & (Even though they have switched to torrents)

More random bitching:
-The average ‘nice’ custom map from is upwards of 20MB)

  • I cant bear sitting at a file transfer screen waiting on monstrous files for 30 minutes because someone else is currently recieving THEIR monstrous files - so I leave after pointlessly downloading half the files. Wasteful?

Please see what you guys can do. I would love to see more custom content rich …content readily delivered upon server connection in Gmod.


Can’t be added with Lua. What kind of model needs a 2048x2048 texture map? A house? A character whose face needs to look perfect (where by “perfect” I mean “as if run over by a noise filter”) from two inches away?

Incidentally, VTF has nothing to do with TGA - the former typically uses the various DXT# formats (S3), the latter only supports uncompressed pixels and RLE.

To kind-of address one of your problems: According to this page, you can use the “I8” texture format for 8-bit grayscale images. If you can figure out how to do that, then ta-da: your “glow” and “reflect” textures can be smaller. Enjoy.

Starships: Each 1 has way more than 32 textures, so they need to be merged to stay under the model texture limit.

What prohibits lua from doing this if you dont mind my asking?

Because lua is only the icing on the cake. You can’t modify the way the engine works with it.