Boost Web Performance: Compress Images with Tencent’s Zhitu Gulp Plugin
Zhitu, a Tencent front‑end tool, compresses PNG, JPEG, GIF images and automatically converts them to optimal formats like WebP; this guide shows how to manually upload images or integrate the gulp‑imageisux plugin into your build process to achieve significant size reductions while preserving visual quality.
Zhitu is a platform developed by Tencent’s front‑end team for image compression and format conversion, supporting PNG, JPEG, GIF and automatically generating WebP versions.
Compressed images retain high visual quality while significantly reducing file size (e.g., a 156 KB image becomes 55 KB).
Zhitu can be used via manual upload at zhitu.isux.us or integrated into a build workflow with the gulp-imageisux plugin.
Using the Gulp Plugin
Install Gulp globally: npm install --global gulp Install the plugin globally: npm install --global gulp-imageisux Create a project structure, e.g.:
test/
│-- img/
│ └── test.jpg
└── gulpfile.jsWrite gulpfile.js:
var gulp = require('gulp');
var imageisux = require('gulp-imageisux');
gulp.task('default', function () {
return gulp.src(['img/*'])
.pipe(imageisux('', true));
});The imageisux function takes two arguments: the destination path for compressed images (empty string creates dest and webp folders) and a boolean indicating whether to generate WebP files.
Run the task in the project directory: gulp After execution, the img directory will contain two new folders, dest (compressed JPEG/PNG) and webp (converted WebP images).
Signed-in readers can open the original source through BestHub's protected redirect.
This article has been distilled and summarized from source material, then republished for learning and reference. If you believe it infringes your rights, please contactand we will review it promptly.
Java High-Performance Architecture
Sharing Java development articles and resources, including SSM architecture and the Spring ecosystem (Spring Boot, Spring Cloud, MyBatis, Dubbo, Docker), Zookeeper, Redis, architecture design, microservices, message queues, Git, etc.
How this landed with the community
Was this worth your time?
0 Comments
Thoughtful readers leave field notes, pushback, and hard-won operational detail here.
