![]() You can install dependencies through npm: Provide some common tool functions for image processing ( image2Canvas, canvas2Blob and canvas2DataUrl, etc.), and users can also customize the style features of image output (for example, grayscale processing, watermarking).Read the EXIF information of jpeg format pictures, and correct the picture orientation.By default, a transparent background color is added to the output image of png, and other formats are set to white to avoid "black screen".You can limit the width and height of the output image to prevent accidents, such as excessive compression operations that cause the browser to crash.A certain threshold can be set for the size of the converted image, so that the image converted to png format will not be too large under undesirable conditions, and at the same time larger than this threshold, it can be automatically converted to jpeg format for better compression.While providing basic image compression functions, it also exposes related public methods of image processing, as well as border case processing: After compression, it is only 5kb, and the image can be compressed on the front-end page. Js-image-compressor is a javascript library that implements lightweight image compression.
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |