1. 29 1月, 2018 2 次提交
  2. 07 8月, 2017 1 次提交
    • A
      Add force_filter and compression_level parameters to (new) `stbi_write_png_to_mem_ex` · 2c7b00ac
      Aarni Koskela 提交于
      * `force_filter` being < 0 means the original behavior (i.e. figure out
        the best-performing filter per scanline); any other values 0 <= x <= 4 correspond
        to PNG filters (0 = none, 1 = sub, 2 = up, 3 = average, 4 = Paeth).
      * `compression_level` being < 0 equals `compression_level` 8 (the previous value).
        The higher this is, the better the compression should be (though it will use
        more memory).
      
      These new parameters are not (yet) exposed for the higher-level API functions.
      2c7b00ac
  3. 01 8月, 2017 1 次提交
  4. 24 7月, 2017 2 次提交
  5. 23 7月, 2017 1 次提交
  6. 05 7月, 2017 2 次提交
    • D
      stb_image_write.h: Allow setting custom zlib compress function for PNG · be211135
      Daniel Gibson 提交于
      The builtin stbi_zlib_compress does not compress as well as zlib or
      miniz (which is not too surprising as it's <200 LOC), thus PNGs created
      by stb_image_write are about 20-50% bigger than PNGs compressed with
      libpng.
      This change lets the user supply a custom deflate/zlib-style compress
      function, which improves compression a lot. This was requested in #113.
      
      Example for zlib:
      
      #include <zlib.h>
      unsigned char* compress_for_stbiw(unsigned char *data, int data_len,
                                        int *out_len, int quality)
      {
        uLongf bufSize = compressBound(data_len);
        // note that buf will be free'd by stb_image_write.h
        // with STBIW_FREE() (plain free() by default)
        unsigned char* buf = malloc(bufSize);
        if(buf == NULL)  return NULL;
        if(compress2(buf, &bufSize, data, data_len, quality) != Z_OK)
        {
          free(buf);
          return NULL;
        }
        *out_len = bufSize;
      
        return buf;
      }
      #define STBIW_ZLIB_COMPRESS compress_for_stbiw
      #define STB_IMAGE_WRITE_IMPLEMENTATION
      #include "stb_image_write.h"
      // ...
      be211135
    • D
      stb_image_write.h: Set PNG compress lvl via stbi_write_png_level · e6bbecd3
      Daniel Gibson 提交于
      This allows the user to change the deflate/zlib compress level used for
      PNG compression by changing a global variable.
      e6bbecd3
  7. 04 7月, 2017 1 次提交
  8. 12 3月, 2017 2 次提交
  9. 04 3月, 2017 1 次提交
  10. 16 1月, 2017 2 次提交
  11. 03 1月, 2017 1 次提交
  12. 15 6月, 2016 1 次提交
  13. 02 4月, 2016 1 次提交
  14. 03 3月, 2016 1 次提交
  15. 26 2月, 2016 1 次提交
  16. 11 2月, 2016 1 次提交
  17. 17 1月, 2016 4 次提交
  18. 14 1月, 2016 1 次提交
  19. 29 10月, 2015 1 次提交
  20. 21 10月, 2015 2 次提交
  21. 17 10月, 2015 1 次提交
  22. 26 9月, 2015 1 次提交
  23. 22 9月, 2015 1 次提交
  24. 14 9月, 2015 3 次提交
  25. 13 9月, 2015 3 次提交
  26. 02 8月, 2015 2 次提交