Pryme8 Posted November 30, 2017 Share Posted November 30, 2017 I can not for the life of me remember what the algorithm is called and https://en.wikipedia.org/wiki/Lossless_compression has so many types not sure which is the one I was looking for. What's the "best" method for compressing an array of any length with values between 0,255? I used one in the past and it had a look up table I think and was like an array with a bunch of other arrays inside of it. It was a long time ago so sorry if this is not very descriptive. End goal is after serialization of a ImageData.data into a smaller/stripped down array is to then hit it with a lossless compression algo before it exports so I can get the Image data I am saving even smaller. Quote Link to comment Share on other sites More sharing options...
brianzinn Posted December 1, 2017 Share Posted December 1, 2017 Was it LZW? https://en.wikipedia.org/wiki/Lempel–Ziv–Welch Pryme8 1 Quote Link to comment Share on other sites More sharing options...
Pryme8 Posted December 1, 2017 Author Share Posted December 1, 2017 YAAAASSSSS, thank you! I had old references that I would work from but they were on one of my other hard-drives so I dont have access to them and have to do it from scratch, but I remember it being super easy to implement. Quote Link to comment Share on other sites More sharing options...
Pryme8 Posted December 7, 2017 Author Share Posted December 7, 2017 Now before I start getting super into deploying a LZW algo, I wanted to see if anyone knows of any lossless methods that will encode a file like this: https://github.com/Pryme8/TileMaster/blob/gh-pages/editor/imgs/Stone_Platform_32.tms to the smallest possible file. GameMonetize 1 Quote Link to comment Share on other sites More sharing options...
BitOfGold Posted December 8, 2017 Share Posted December 8, 2017 @Pryme8 Two easy methods for compressing files: - you can use deflate on webserver: all files arrive with automatic gzip transfer encoding to the browser. just some .htaccess settings on apache. - jszip. Easy file access from a zip file. I'm already using this (in my engine I'm working on), not just compression but lower the number of http requests. https://stuk.github.io/jszip/ Pryme8 1 Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.