pyheif | Python 3.6 interface to libheif | Reactive Programming library
kandi X-RAY | pyheif Summary
kandi X-RAY | pyheif Summary
Python 3.6+ interface to libheif library using CFFI. Note: currently only reading is supported.
Support
Quality
Security
License
Reuse
Top functions reviewed by kandi - BETA
Currently covering the most popular Java, JavaScript and Python libraries. See a Sample of pyheif
pyheif Key Features
pyheif Examples and Code Snippets
Community Discussions
Trending Discussions on pyheif
QUESTION
I could easily convert HEIC to JPEG in python with a pyheic library. But the filesize gets larger when it's converted to JPEG. (About 4 times). Can I reduce the size of the file saving it?
How can I get base64-encoded string instead of saving JPEG image?
My code is as follows:
...ANSWER
Answered 2021-Dec-02 at 11:47Since you are converting from one data type to the other the format is changing. I am not too familiar with HEIC but it could be the case that it is simply a smaller file size with the compression parameters that you have set for the JPEG.
wikipedia has the following to say about it
A HEIF image using HEVC requires less storage space than the equivalent quality JPEG.
So unless you want to drop the quality it might not even be possible to get a smaller image (note: I have no idea what type the HEIC/HEIF is).
As for the base64 encoded string, you could just read the binary data and convert it to base64 per this question: Python: How do I convert from binary to base 64 and back?
Community Discussions, Code Snippets contain sources that include Stack Exchange Network
Vulnerabilities
No vulnerabilities reported
Install pyheif
Support
Reuse Trending Solutions
Find, review, and download reusable Libraries, Code Snippets, Cloud APIs from over 650 million Knowledge Items
Find more librariesStay Updated
Subscribe to our newsletter for trending solutions and developer bootcamps
Share this Page