Dismiss Notice
60,000 passwords have been reset on July 8, 2019. If you cannot login, read this.

Importing and using .jpg images

Discussion in 'StarCraft II Tutorials' started by Tylon, Aug 18, 2010.

  1. Tylon

    Tylon

    Joined:
    Apr 21, 2006
    Messages:
    122
    Resources:
    1
    Tutorials:
    1
    Resources:
    1
    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.
     
  2. Dr Super Good

    Dr Super Good

    Spell Reviewer

    Joined:
    Jan 18, 2005
    Messages:
    26,124
    Resources:
    3
    Maps:
    1
    Spells:
    2
    Resources:
    3
    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...
     
  3. JackRCDF

    JackRCDF

    Joined:
    May 13, 2010
    Messages:
    65
    Resources:
    1
    Tutorials:
    1
    Resources:
    1
    .dds is what it uses for practically everything 2D, eg terrain, textures, icons, probably the GUI, etc.
     
  4. Tylon

    Tylon

    Joined:
    Apr 21, 2006
    Messages:
    122
    Resources:
    1
    Tutorials:
    1
    Resources:
    1
    It's just that .dds has to be powered of 2.
     
  5. Dr Super Good

    Dr Super Good

    Spell Reviewer

    Joined:
    Jan 18, 2005
    Messages:
    26,124
    Resources:
    3
    Maps:
    1
    Spells:
    2
    Resources:
    3
    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.
     
  6. Rispetto

    Rispetto

    Joined:
    Jul 1, 2009
    Messages:
    1,080
    Resources:
    3
    Tutorials:
    3
    Resources:
    3
    Wrong.

    [​IMG]
     
  7. Dr Super Good

    Dr Super Good

    Spell Reviewer

    Joined:
    Jan 18, 2005
    Messages:
    26,124
    Resources:
    3
    Maps:
    1
    Spells:
    2
    Resources:
    3
    Maybe I was 1 pixel off (well 153 pixels off) , but the fact remains...
    ln(76)/ln(2) is not a whole number and thus not a power of 2. Thus proving .dds supports textures that are not powers of 2.