Simple CLI tool to convert HEIC files to JPG, PNG, or WebP
Project description
HEIC2IMG Converter
A simple command-line tool to convert HEIC/HEIF images (commonly used by iPhones) to more widely compatible formats like JPG, PNG, or WebP with aggressive file size optimization.
Features
- Convert HEIC/HEIF images to JPG, PNG, or WebP formats
- Aggressive file size optimization for sharing on platforms like Facebook Marketplace or Craigslist
- Automatic file size limiting (default 2MB maximum)
- Resize images to reduce file size even further
- Option to delete original HEIC files and associated MP4 files after conversion
- Batch processing of multiple files
- Simple command-line interface
Installation
pip install heic2img-converter
Usage
Basic usage:
heic2img /path/to/heic/files
This will convert all HEIC files in the specified directory to JPG format with default compression settings.
Options
heic2img [input_dir] [options]
options:
-h, --help Show this help message and exit
-o OUTPUT, --output OUTPUT
Output directory (optional)
-f {jpg,png,webp}, --format {jpg,png,webp}
Output format (default: jpg)
-q QUALITY, --quality QUALITY
Quality setting (0-100, lower = smaller file size, default: 75)
-m MAX_SIZE, --max-size MAX_SIZE
Maximum dimension (width or height) in pixels
--max-file-size MAX_FILE_SIZE
Maximum file size in MB (default: 2.0)
--delete-originals Delete original HEIC files and associated MP4 files after successful conversion
Examples
Convert all HEIC files to JPG with maximum compression (smallest file size):
heic2img /path/to/heic/files -q 50
Convert to WebP format (often provides better compression than JPG):
heic2img /path/to/heic/files -f webp -q 60
Resize images to a maximum of 1200 pixels (width or height) while converting:
heic2img /path/to/heic/files -m 1200
Set a custom maximum file size (e.g., 1MB):
heic2img /path/to/heic/files --max-file-size 1.0
Convert to a different directory:
heic2img /path/to/heic/files -o /path/to/output
Convert and delete original HEIC files and associated MP4 files:
heic2img /path/to/heic/files --delete-originals
Tips for Smallest File Size
For platforms like Facebook Marketplace or Craigslist where image quality isn't critical:
- Use WebP format for best compression:
-f webp - Lower the quality setting:
-q 50(or even lower if acceptable) - Resize large images:
-m 1200(or smaller if acceptable) - Set a strict file size limit:
--max-file-size 1.0(for 1MB maximum)
Example for maximum compression:
heic2img /path/to/heic/files -f webp -q 40 -m 1000 --max-file-size 1.0
Requirements
- Python 3.11+
- Pillow
- pillow-heif
- tqdm
License
MIT
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file heic2img_converter-0.1.1.tar.gz.
File metadata
- Download URL: heic2img_converter-0.1.1.tar.gz
- Upload date:
- Size: 15.3 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.1.0 CPython/3.11.10
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
cabd3b44fbf83defbf7d7843780aa0c838fbcd7965ada45bf06f7cb8bcbb02a3
|
|
| MD5 |
c55fc0d281ebe203d5a73cd6ff54e268
|
|
| BLAKE2b-256 |
b3bb8b44e8d51f94cdeba7f449e453a8269d152fdd6f94953e9b763c4f48174d
|
File details
Details for the file heic2img_converter-0.1.1-py3-none-any.whl.
File metadata
- Download URL: heic2img_converter-0.1.1-py3-none-any.whl
- Upload date:
- Size: 6.4 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.1.0 CPython/3.11.10
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
73beddc79403d23b185506acfc5fd63308690ce3c9af24f25961460e8d35ed6d
|
|
| MD5 |
72118884c6d416cc9ae8332559427836
|
|
| BLAKE2b-256 |
d33fe25e88a5796894e5bc0cf0da06956575267fe16b93e92b8a86055c15885c
|