Skip to main content

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:

  1. Use WebP format for best compression: -f webp
  2. Lower the quality setting: -q 50 (or even lower if acceptable)
  3. Resize large images: -m 1200 (or smaller if acceptable)
  4. 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


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

heic2img_converter-0.1.0.tar.gz (15.2 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

heic2img_converter-0.1.0-py3-none-any.whl (3.2 kB view details)

Uploaded Python 3

File details

Details for the file heic2img_converter-0.1.0.tar.gz.

File metadata

  • Download URL: heic2img_converter-0.1.0.tar.gz
  • Upload date:
  • Size: 15.2 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.11.10

File hashes

Hashes for heic2img_converter-0.1.0.tar.gz
Algorithm Hash digest
SHA256 c691c29a14bcd780138303be780a48aeb9eb7478d255199d26ced6969144bbe5
MD5 bd9ea0ed96bd652e8b61138c2d319b62
BLAKE2b-256 efa960802aa0de6d76f76eba0f3e648de46651747d2981ee40a0a0b0507bccae

See more details on using hashes here.

File details

Details for the file heic2img_converter-0.1.0-py3-none-any.whl.

File metadata

File hashes

Hashes for heic2img_converter-0.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 73cd3a5b03563f615481ff736e41ce940b4a5fa8e362b432194f5a022ea6e4dd
MD5 2530bc05d7cc8d02ad3f4d91cb5d6233
BLAKE2b-256 af4a84336813c2f0f4bca58f7457197d992183eb9fa41703865a906732ed58b1

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page