+
Skip to content

A js image compression tool. The function is written in C, using the libimagequant and libpng libraries, reading png images for compression, and then exporting wasm to run on the page, so that the images can be compressed directly on the page without uploading to the server for processing.

License

Notifications You must be signed in to change notification settings

numandev1/pngtiny

 
 

Repository files navigation

#js version png compression tool

  • 2021.10.14 Add jpg image compression
  • 2021.10.19 Add GIF image compression
  • 2022.01.06 Add demo address

use

Just deploy the web folder to the server for access (needs to be accessed from a browser that supports webassembly, such as Chrome, edge)

You can visit demo

illustrate

  • This project uses https://github.com/ImageOptim/libimagequant, https://github.com/glennrp/libpng, https://github.com/kohler/gifsicle and https://www.ijg.org /library
  • libimagequant is a library that compresses png24 into png8, and the compression effect is very good. libpng is a library for reading and generating pngs. libjpeg is a library for reading and compressing jpg. gifsicle is a library for reading and compressing gifs.
  • If you need to compile your own compression code, first install the new version of emsdk environment on your computer environment, and then run the build.bat file.
  • Then overwrite the files in the web folder with the compiled pngtiny.js and pngtiny.wasm files.

About

A js image compression tool. The function is written in C, using the libimagequant and libpng libraries, reading png images for compression, and then exporting wasm to run on the page, so that the images can be compressed directly on the page without uploading to the server for processing.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • C 93.1%
  • JavaScript 4.9%
  • Other 2.0%
点击 这是indexloc提供的php浏览器服务,不要输入任何密码和下载