Announcement

Collapse
No announcement yet.

Updated Basis Universal Yields High Quality Compression, 3~4x Smaller Than JPEG/PNG

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

  • #11
    Remdul Thanks from me as well!

    Comment


    • #12
      Originally posted by MadeUpName View Post
      I am not exactly sure why you need the graphics card to decode a single image in 2020. Thousands of images in a very short time like a movie or game yes but individual images? I will keep an open mind but so far it feels like a solution looking for a problem.
      Images are everywhere on the web, improving the efficiency is always welcome. Think of the billions of devices around the world which access thousands of pictures a day. Also the web doesn't stand still, 3D elements are still rare due to their constrain on resources. WebGL was the first move to push the graphics on the web further. Also think of Webassembly and other technologies which promote the model of demanding apps in the browser. And to improve on that work, it seems that such compression technology was needed.

      Another use case for this technology is texture compression/decompression in game engines. From their news release in 2019: "The Basis Universal texture format is 6-8 times smaller than JPEG on the GPU, yet is a similar storage size as JPEG – making it a great alternative to current GPU compression methods that are inefficient and don’t operate cross platform – and provides a more performant alternative to JPEG/PNG. It creates compressed textures that work well in a variety of use cases - games, virtual & augmented reality, maps, photos, small-videos, and more!"

      Comment


      • #13
        That is an extremely confusing way to say that, Michael

        Comment


        • #14
          So... I'm confused too.

          I downloaded the source and compressed a few files with it's utility.
          The results are.. interesting..

          1 4k png image
          PNG: 13.6 MiB
          JPEG: 1.5 MiB
          WebP: 1.4 MiB
          .basis (this texture stuff): 8 MiB

          Same image in thumbnail size (200x113 in this case)
          PNG: 50 KiB
          JPEG: 16 KiB
          WebP: 6.5 KiB
          .basis (this texture stuff): 23 KiB

          Source image:
          https://imgur.com/TRHiKxX
          I used this command for .basis: "basisu -uastc -uastc_level 2 -uastc_rdo_q .75 <file>"

          Now this is just a wallpaper/photography file. It's likely not the intended target for game engines and their textures! So take this with a bag of salt!

          I cannot draw any conclusions from this as i kinda miss a few things here to make sense of it. For instance, i don't know how texture data in games is stored on disc at the moment. If that is in PNG (which i doubt) or in BMP (which i suspect) then in either those cases .basis is going to save quite a ton of disc space too. As for BMP and why i didn't measure that one. It's always bigger then PNG so why bother.

          I'm guessing the huge space saving is in GPU memory.
          As for others who asked why this format is any good at all in 2020. Think of it this way, with this format the game can load more texture data in memory and give you a better gaming experience. As you won't see texture jumping/loading or a lot less. And if you have loading screens, they can load (much) faster.

          Or that's my assumptious take on it anyhow. As said though, take this with a bag of salt! It's just (educated) guess work.

          Comment


          • #15
            I think I understand the confusion now. Basis isn't intended for typical images/photos (i.e. cat pictures) used on websites, but for WebGL; it's a container format to store textures in.

            The basis format probably also (optionally) stores mipmaps for textures, which would increase size a tad. Remember, with PNG and JPEG, these mipmaps also need to be generated by the browser/API/driver/GPU while uploaded. Uploading compressed mipmaps also shaves off some CPU cycles.

            markg85 5: ASTC supports a variety of bitrate formats, as well as HDR, so you may need to play a bit to find the right quality/size ratio depending on the image.

            Most games store textures in proprietary formats, or some standardized ones, like DDS for DXT1-5. So they were already compressed, and wouldn't same much disk space. But some games also store other texture compression formats, mobile games for example might provide ETC1/2 in parallel, which is entirely different. This is exactly what Basis is intended for, to unify those files into one smaller file.

            Also, Basis alone will not reduce GPU memory usage if an application already utilized texture compression. Basis is 'only' an extra compressed intermediate container format. It's just really clever in the way it compresses things while maximizing compatibility across a variety of texture compression standards.
            Last edited by Remdul; 21 March 2020, 04:44 PM.

            Comment


            • #16
              Originally posted by markg85 View Post
              So... I'm confused too.

              I downloaded the source and compressed a few files with it's utility.
              The results are.. interesting..

              1 4k png image
              PNG: 13.6 MiB
              JPEG: 1.5 MiB
              WebP: 1.4 MiB
              .basis (this texture stuff): 8 MiB

              Same image in thumbnail size (200x113 in this case)
              PNG: 50 KiB
              JPEG: 16 KiB
              WebP: 6.5 KiB
              .basis (this texture stuff): 23 KiB

              Source image:
              https://imgur.com/TRHiKxX
              I used this command for .basis: "basisu -uastc -uastc_level 2 -uastc_rdo_q .75 <file>"

              Now this is just a wallpaper/photography file. It's likely not the intended target for game engines and their textures! So take this with a bag of salt!

              I cannot draw any conclusions from this as i kinda miss a few things here to make sense of it. For instance, i don't know how texture data in games is stored on disc at the moment. If that is in PNG (which i doubt) or in BMP (which i suspect) then in either those cases .basis is going to save quite a ton of disc space too. As for BMP and why i didn't measure that one. It's always bigger then PNG so why bother.

              I'm guessing the huge space saving is in GPU memory.
              As for others who asked why this format is any good at all in 2020. Think of it this way, with this format the game can load more texture data in memory and give you a better gaming experience. As you won't see texture jumping/loading or a lot less. And if you have loading screens, they can load (much) faster.

              Or that's my assumptious take on it anyhow. As said though, take this with a bag of salt! It's just (educated) guess work.
              Can you try gzip/bzip2/xz/etc. that basis file? i am not sure but i suspect the basis is the in memory format to give to the gpu to decompress but for storage you'd sue some other regular compression too?

              Comment


              • #17
                Originally posted by raster View Post

                Can you try gzip/bzip2/xz/etc. that basis file? i am not sure but i suspect the basis is the in memory format to give to the gpu to decompress but for storage you'd sue some other regular compression too?
                Why don't you try it yourself?
                It's not rocket science. It's literally plain old simple executing the compression command for each of the formats you just said.

                You're self-quarantined too i suppose. Have fun running those yourself.

                But i will give you a suggestion. I did try using zstd and the 23 KiB file became.... 22 KiB.. So no savings there. The 8 MiB file from the 4k image did became substantially smaller, it went to 6 MiB. Any further testing is your fun.

                Comment


                • #18
                  Originally posted by Remdul View Post
                  I think I understand the confusion now. Basis isn't intended for typical images/photos (i.e. cat pictures) used on websites, but for WebGL; it's a container format to store textures in.

                  The basis format probably also (optionally) stores mipmaps for textures, which would increase size a tad. Remember, with PNG and JPEG, these mipmaps also need to be generated by the browser/API/driver/GPU while uploaded. Uploading compressed mipmaps also shaves off some CPU cycles.

                  markg85 5: ASTC supports a variety of bitrate formats, as well as HDR, so you may need to play a bit to find the right quality/size ratio depending on the image.

                  Most games store textures in proprietary formats, or some standardized ones, like DDS for DXT1-5. So they were already compressed, and wouldn't same much disk space. But some games also store other texture compression formats, mobile games for example might provide ETC1/2 in parallel, which is entirely different. This is exactly what Basis is intended for, to unify those files into one smaller file.

                  Also, Basis alone will not reduce GPU memory usage if an application already utilized texture compression. Basis is 'only' an extra compressed intermediate container format. It's just really clever in the way it compresses things while maximizing compatibility across a variety of texture compression standards.
                  Hi @Remdul,

                  Hmm, oke. So it's not the "10 years ahead" format of it's time, like the initial news about basis suggested when it wasn't released yet. It's "merely" a container format (say like mkv) to have one uniform way of storing textures. Am i getting that right?

                  Also, i specifically tried this on a picture and a thumbnail thereof. Just to see if a usecase of using basis in desktop applications (think of a file browser with thumbnail previews on) would be a potential use for it. Right now i'm inclined to think it's not ideal for that because generating the basis file (for that 4k file) took 140 seconds (1 core at 100%). It doesn't mean it's not usable at all.. perhaps if the tooling get optimized and uses all cores it could generate it faster then generating a thumbnail in a regular PNG or JPEG file, but i doubt that. This is only for the case where no basis file exists and one has to be generated. In folders where all images do have a basis file, this might be faster.

                  Comment


                  • #19
                    Originally posted by Remdul View Post
                    Do keep in mind that the Basis compression will be lossy compared to PNGs, but likely offer better quality than JPEGs of similar file size (I think that's part of the claim).
                    it's hard to believe. jpegs compress more than 4x, so jpeg will be smaller. and i'm sure png can compress more than 4x and have no quality loss at all. i.e. all this marvel of marketing can provide is reduced pcie bandwidth requirements. which is pointless because web browser has to download picture via smaller internet bandwidth first, i.e. total time will be smaller with jpeg/png. what would be useful is shader which translates jpeg/png to gpu codec, not sure how it is feasible though

                    Comment


                    • #20
                      Originally posted by markg85 View Post

                      Why don't you try it yourself?
                      It's not rocket science. It's literally plain old simple executing the compression command for each of the formats you just said.

                      You're self-quarantined too i suppose. Have fun running those yourself.

                      But i will give you a suggestion. I did try using zstd and the 23 KiB file became.... 22 KiB.. So no savings there. The 8 MiB file from the 4k image did became substantially smaller, it went to 6 MiB. Any further testing is your fun.
                      i have a broken wrist so I'm actually having a hard time using the keyboard. i just had surgery on it to get bolts in it and am recovering in splints and bandages and painkillers. anything involving shift/ctrl and multiple chords like shell, code is really hard with 1 hand. since you already had the files and probably 2 working hands, i though it might be easier for you to give it a try.
                      Last edited by raster; 22 March 2020, 08:47 AM.

                      Comment

                      Working...
                      X