Skip to main content

Convert image to High Efficiency Image (HEIC/AVIF) and back with ease.

Project description

Heiya

A one line solution for photographers who are looking to replace their JPEGs with High Efficiency Images(HEIs).

Introduction

High Efficiency Image (HEI) - Ya!

Get it?

It is unbelieveable that JPEG is from... last century. And the majority of cameras in the current age shoot JPG. Some can encode using HEIC (iPhone, Fujifilm X-H2S, ...), but that codec is inside a paywall. Most cameras do not support AVIF, but it is the future for image codec and many operating system already support AV1 (and therefore AVIF).

HEIC and AVIF are what is called "High Efficiency Images", and can result in file size 10x less than traditional JPEGs. However, there is no easy solution to simply convert JPEG/TIFF to HEIC/AVIF and preserve all the metadata.

Heiya is an open source wrapper for easy High Efficiency Image (AVIF/HEIC) to and from JPG conversion. It is developed for photographers to build a more automatic and space saving pipeline.

System Requirements

Heiya is developed on macOS and isn't tested on Windows or other OS such as Linux.

Install Heiya

Install from PIP

pip install heiya

Upgrade from PIP

pip install heiya --upgrade

Examples

Getting Started

import heiya

Define Source Directory

# Option 1: Define it by yourself
source_dir = ""

# Option 2: Get the directory directly from the clipboard
import pyperclip as clip

if source_dir == "":
    source_dir = clip.paste()

Batch JPG/TIF -> HEI in directory

heiya.to_hei.convert_image_in_dir(source_dir, source_tif=False, source_jpg=True, 
                                  target_hif=False, target_avif=True)

Batch IMG -> HEI in directory using depth

Example: 
    /Photos/2022/01/20220105/img1.jpg, ...
    Then with source_dir = "/Photos":
        depth = 0 -> "/Photos"
        depth = 1 -> "/Photos/2022"
        depth = 2 -> "/Photos/2022/01"
        depth = 3 -> "/Photos/2022/01/20220105"
heiya.to_hei.convert_all_sub_folders_to_hei(source_dir, source_tif=False, source_jpg=False, 
                                            target_hif=False, target_avif=False, depth=2)

Batch HEI -> JPG in directory

heiya.from_hei.convert_hei_in_dir_to_jpg(source_dir, source_hif=False, 
                                         source_avif=False, fix_rotation=True)

Batch JPG -> HEI -> JPG in directory

heiya.tools.convert_jpg_to_he_jpg(source_dir, use_hif=False, 
                                  use_avif=True, preserve_original_jpg=True)

Delete files with a specific extension in directory

heiya.tools.delete_image_in_dir(source_dir, tif=False, jpg=False, hif=False, avif=False)

Change log

NOTE: Not production ready yet.

[0.1.0] - 2022-10-02

  • Attempting to fix an issue of incorrect param call from heiya.he_jpg.convert_jpg_to_he_jpg.

[0.0.9] - 2022-10-02

  • Unsuccessful fix for an issue of incorrect param call from heiya.he_jpg.convert_jpg_to_he_jpg.

[0.0.8] - 2022-10-02

  • Standarized function names for from_hei and to_hei.

[0.0.7] - 2022-10-02

  • Fixed an issue of internal packages not being able to properly import.

[0.0.6] - 2022-10-02

  • Added extensions and tools to __init__.py to fix referencing issue.

[0.0.5] - 2022-10-02

  • Removed the requirement for glob.

[0.0.4] - 2022-10-02

  • Removed the requirement for os.

[0.0.3] - 2022-10-02

  • Code cleanup.

[0.0.2] - 2022-10-02

  • Initial upload.

[0.0.1] - 2022-10-01

  • Created the project.

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

heiya-0.1.0.tar.gz (11.9 kB view details)

Uploaded Source

Built Distribution

heiya-0.1.0-py3-none-any.whl (12.7 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: heiya-0.1.0.tar.gz
  • Upload date:
  • Size: 11.9 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.1 CPython/3.8.13

File hashes

Hashes for heiya-0.1.0.tar.gz
Algorithm Hash digest
SHA256 72b855ae8b2b259812a71779936feea9b5e9a8e184dd0d1a3d1482111dd68733
MD5 e91460554ae4434d5c7273355d706f79
BLAKE2b-256 719092ece316adff42f2d53982bf6d124a7afe05b83f78041c4570b070babd5e

See more details on using hashes here.

File details

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

File metadata

  • Download URL: heiya-0.1.0-py3-none-any.whl
  • Upload date:
  • Size: 12.7 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.1 CPython/3.8.13

File hashes

Hashes for heiya-0.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 cd3b56308714f8057c91df691892b942f94630309b2441e4a2d4bfd57ff25439
MD5 b64e19f5e52d010f6deab150abe60a6e
BLAKE2b-256 74a81ca69815e5f93649dbb61c1db3d722b1f45d66201d33fd338a949b7f933d

See more details on using hashes here.

Supported by

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