Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up

Compress png images right in your browser

NotificationsYou must be signed in to change notification settings

psych0der/pngquantjs

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

21 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Pngquant.js is a port ofpngquant lib in js, made possible byemscripten which compiles LLVM bit code generated from c/c++ directly to javascript. Pngquant js can compress png images right in your browser without any server requirements. This can open a wide array of possibilities of what can be achieved on a browser, with clients compressing the static assets on their device itself, saving precious bandwidth.

Build

This version of pngquantjs is built using v2.8.0 ofpngquant. Originalconfigure script needs to be patched in order to be used by emscripten. Patched version of this file is present in the deps folder in this directory. Additionally, patch file for configure script is also present in the repository in order to create a fresh copy. Build script assumes that emscripten is already built and available in the system path. Once this is ensured, just run./build.sh which will initiate build process and pngquant.js will be available in dist folder.This file can be easily compressed using uglify.js. I haven't included the command to use uglify.js in the build script (planning to do so soon), but a minified version of pngquant.js is included in the demo folder.Since the process of setting up emscripten is tedious and may pollute the global namespace, I have created a docker image which comes preinstalled with emscripten and all environments initialized. It's available atthis link and can be used by issuing docker pull psych0der/emscripten command. I would recommend using docker image since it greatly simplifies working with emscripten without thinking about any installation issue.

Demo

https://psych0der.github.io/pngquantjs/

License

About

Compress png images right in your browser

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

[8]ページ先頭

©2009-2025 Movatter.jp