• 🏆 Texturing Contest #33 is OPEN! Contestants must re-texture a SD unit model found in-game (Warcraft 3 Classic), recreating the unit into a peaceful NPC version. 🔗Click here to enter!
  • It's time for the first HD Modeling Contest of 2024. Join the theme discussion for Hive's HD Modeling Contest #6! Click here to post your idea!

Importing and using .jpg images

Level 4
Joined
Apr 21, 2006
Messages
126
Galaxy Editor doesn't support .jpg images, but the game itself does.
You can use normal .tga files instead, but they are about 10 times as large in file size.

So here is how to import and use your .jpg image in your map:

1. In windows explorer, simply rename your image file and replace the .jpg extension with .tga.
"example.jpg" to "example.tga"

2. Import the renamed image into your map.
You WILL get errors and GE will not show the preview.

3. Save.

Done! You can now use the image in dialogs or as loading screen. You might get errors sometimes when doing things with the image, but it will show up correctly ingame.
 

Dr Super Good

Spell Reviewer
Level 64
Joined
Jan 18, 2005
Messages
27,198
Hmmm, why on earth does it not accept the .jpeg extension yet excepts something stored with jpeg standards as a .tga...

Well I understand how it happens. It simply passes the file to a module which opens it and returns an array of pixels in some form and as such it ignores file extension and reads the file header to choose the format used (jpeg and tga use different header data) so it will load anything supported called anything. However the fact that it accepts loading .tga but not .jpeg still is bothering me.

Also what about .dds image types? Are those not supported by the engine as well...
 
Level 4
Joined
May 13, 2010
Messages
66
Hmmm, why on earth does it not accept the .jpeg extension yet excepts something stored with jpeg standards as a .tga...

Well I understand how it happens. It simply passes the file to a module which opens it and returns an array of pixels in some form and as such it ignores file extension and reads the file header to choose the format used (jpeg and tga use different header data) so it will load anything supported called anything. However the fact that it accepts loading .tga but not .jpeg still is bothering me.

Also what about .dds image types? Are those not supported by the engine as well...
.dds is what it uses for practically everything 2D, eg terrain, textures, icons, probably the GUI, etc.
 

Dr Super Good

Spell Reviewer
Level 64
Joined
Jan 18, 2005
Messages
27,198
I do not think so...
The one icon tutorial shows someone making a .dds with the demensions of 77*77. Additionally if you choose an icon inside SC2 it says it is 77*77.

The official .dds specification says nothing about it having to be powers of 2. It is probably easier however to calculate the mipmap levels that way.

Anyway .jpeg has to be multiples of atleast 8 (16 or 32 if chroma subsampling is used). If its not it still is stored as a multiple of 8.
 
Additionally if you choose an icon inside SC2 it says it is 77*77.

Wrong.

Wrong.png
 
Top