简体   繁体   中英

Can I use cv.imencode in Opencv.js to export webp images?

I want to transform the format of images from any extension(ex. png, jpg) to webp . So I checked the OpenCV.js but I couldn't find cv.imencode method to create webp images. Does it support cv.imencode method? If not, I will use other server side languages, java, python, etc. Thank you.

no, sadly you cannot do this. there are no image codecs wrapped into opencv.js at all (and the only builtin method to read an image is by grabbing one from a pre-filled canvas)

however, there are 3rdparty js libs like Jimp for this

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM