Compressed BMP's

Discussion in 'Programming/Html' started by JGraham, Oct 16, 2013.

  1. JGraham

    JGraham Guest

    Messages:
    5
    Likes Received:
    0
    GPU:
    ATI 128MEG
    Hi Guys.

    I'm looking for a solution to a problem we have.

    We use uncompressed 24bit BMP's as a texture standard for our game, but recently we have added a lot more BMP graphics. The number is becoming a problem to handle, because of the size, and number of files.

    Now, at present, we load these as uncompressed BMP's, but we would like to add the BMP's to a compressed easy to create archive, and load to the game from the archive directly.

    Does anyone have any ideas if this is possible to do?
     
  2. Mangix

    Mangix Guest

    yes it is. it's called PNG.

    here's a comparison of many different lossless archivers that work on such data: http://www.imagecompression.info/gralic/

    not all are open source and i think that PNG is the way to go.
     
  3. JGraham

    JGraham Guest

    Messages:
    5
    Likes Received:
    0
    GPU:
    ATI 128MEG
    Hi Mangix.

    We can't change the actual format of the files from BMP to PNG, because there are loads of user mods in BMP, outside of the new standard texture set.

    We were wondering if we could pack all of the textures into a 7Zip archive, and read directly from the packed files. We don't need to read individual BMP's, just load the entire archive.
     
  4. Xendance

    Xendance Guest

    Messages:
    5,555
    Likes Received:
    12
    GPU:
    Nvidia Geforce 570
    Images are really, really hard to compress, lossless even more so. Using archivers like 7zip etc does nothing, you need to save the images as different format.
    It shouldn't really matter, BMP isn't any better for games than PNG.
    Only DXT compressed textures are hardware accelerated.
     

  5. mbk1969

    mbk1969 Ancient Guru

    Messages:
    15,598
    Likes Received:
    13,606
    GPU:
    GF RTX 4070
    What language?
    And which problem you want to solve?
     
    Last edited: Oct 17, 2013
  6. JGraham

    JGraham Guest

    Messages:
    5
    Likes Received:
    0
    GPU:
    ATI 128MEG
    Hi Guys.

    We are working in C under Dx7! Well the game is very old!!

    We have used BMP 24Bit as a standard texture in 512x512 and 256x256, and we used these uncompressed. We also use a compressed version of PCX in 8bit colour, but because some people run the game in Glide, they are stuck in 8Bit land, where as if you run in D3D, we can enjoy full colour.

    i noticed that a BMP compressed by 7Zip went from 768kb to only 67kb, which is a massive saving in HD space. Now if we packed all of the hundreds of BMP textures into one 7Zip archive, firstly it would be easier to keep all the textures together, and reduce the HD space needed.

    Our old 8bit textures are held in a CDF file which is a non compressed indexed file, but this system will not work for BMP's.

    We can't change formats as we have been building mods and re skinning in BMP for over 5 years, and there are thousands of textures that would need to be converted, so changing is a non starter.

    What about Windows compressed Zip folders? We are just looking for a simple way of adding a better way of storing BMP's, and accessing them by our game engine.
     
    Last edited: Oct 17, 2013
  7. scatman839

    scatman839 Ancient Guru

    Messages:
    14,121
    Likes Received:
    538
    GPU:
    3080, KD55XD800
    Use this.

    http://www.libarchive.org/

    And I wouldn't recommend putting all the textures in one zip/rar/whatever, the game would have to decompress all of it to just get one texture.
     
  8. JGraham

    JGraham Guest

    Messages:
    5
    Likes Received:
    0
    GPU:
    ATI 128MEG
    Hi Scatman839.

    Thanks for the link.

    Every file is loaded at the time you launch the game, so there is no reading of just one or a group, the whole archive has to be loaded.
     
  9. mbk1969

    mbk1969 Ancient Guru

    Messages:
    15,598
    Likes Received:
    13,606
    GPU:
    GF RTX 4070
  10. Mangix

    Mangix Guest

    I take it there's nothing preventing you from decompressing the PNG to BMP when the game loads? PNG decompression is faster than LZMA(7-Zip).
     

  11. Anarion

    Anarion Ancient Guru

    Messages:
    13,599
    Likes Received:
    387
    GPU:
    GeForce RTX 3060 Ti
    ^^That would be rather good option to be honest.
    Already compressed images don't compress (in archive) but uncompressed images will.
     
    Last edited: Oct 19, 2013

Share This Page