Package: heiya
HeiyaA one-line solution for photographers to simply convert JPEG into High Efficiency Image (AVIF/HEIC) and preserve all the metadata.WebsiteThe official website of Heiya has been launched!!!!! Visit the websiteherefor everything about it.AnnouncementHeiya is iterating quickly under active development.
Function calls and arguments will change, so please keep your version updated and refer to the newest examples in the documentation.IntroductionHeiya allows you to easily translate between JPG/TIFF and AVIF/HEIC, without losing image metadata such as geotag and lens information. All the common operations can be done using one line of code.It is developed for photographers with a storage budget (like myself, lol) to build an automatic and efficient image storage pipeline.JPEG was invented six years before my existence.
I'm now 24, graduating from my double Master's degree next summer.And yet, the majority of cameras in the current age still shoot JPEG.AVIF and HEIC are what are called "High-Efficiency Images" (You can read about them here:AVIF vs HEIC).These are the future of media formats, JPEG is getting deprecated.They can result in a file size of as much as 100x less than traditional JPEGs.Devices and operating systems now have good support for both formats.However, there are no free and easy-to-use tools out there to simply encode all the JPEGs my camera took into AVIFs while preserving metadata.Install Heiya from PyPIHeiya is developed and tested on macOS and hasn't been tested on Linux, it doesn't support Windows for now.pipinstallheiyaExamples"""JPG to HEIF/AVIFConvert JPG shoot by camera to High Efficiency Images with metadata to import to iCloud photo library.Find this notebook in https://github.com/wu-hongjun/heiya/blob/main/jpg_hei.ipynbHow To:Step 1: Run "pip install heiya" from Terminal (If you have not already done so).Step 2: Copy the folder directory where all the JPGs are stored.Windows: File Explorer -> Go to your target folder -> Single Click address bar -> Copy the file path in address bar.macOS: Finder -> Go to your target folder -> Hold Alt (File path should apper in bottom left) -> Right click on folder and copy file path.Step 3: Run this cell and wait for it to finish, it will print out progress below."""importheiyaimportpyperclipasclip# Custom file path override, usually just leave it blank if you use pyperclipsource_dir=""# Get the image location directly from the clipboardifsource_dir=="":source_dir=clip.paste()# This will convert all the JPG in source_dir to HEI.# source_format = 0 -> JPG. (You don't need to change this for most of the time, you can also set to 1 for PNG.)# target_format = 0 -> AVIF (For smaller file size but less compatible, requires iOS 16/macOS Ventura or higher).# target_format = 1 -> HEIF (For best compatibility but slightly larger file size, requires additional extension to open on Windows).heiya.to_hei.convert_image_in_dir_to_hei(source_dir,source_format=0,target_format=1)Some basic operations can be found inHeiya Basic Demo Notebook.A complete set of heiya examples can be found in theHeiya Full Demo Notebook.To-Do & Help NeededAttempt an implementation usingimagemagickto enable bitrate higher than the current 8 bit.What does the name mean?HEI - High Efficiency Image.Ya - In Chinese, 压(yā) means "to compress".But mostly just a reference to uncle Roger's "Heiya" when he saw the BBC host rinse and drain cooked rice with tap water (smh... here's thevideo).Update HistoryA complete update log can be found in theHISTORY.md.LicenseHeiya is distributed with the license inLICENSE.txt.Change log[2.3.1] - 2023-02-18Minor improvement on video to H265 encoder, added-movflags use_metadata_tagsto better preserve metadata in video.[2.3.0] - 2023-01-08Added auto H265 encoding capabilities. Updated example pipeline inpipeline.ipynb.[2.2.2] - 2022-12-5Added minor support to non dotted extensions in heiya.extensions.[2.2.1] - 2022-12-4Fixed a bug that registers incorrect HEI opener for pillow_heif.[2.2.0] - 2022-12-4Added initial experimental support for Windows.[2.1.0] - 2022-11-1Added tools for image to webp pipeline.[2.0.0] - 2022-10-30Refactored code for better expandability going forward.Note that this version is not compatible with the previous version, as many functions now have new arguments.[1.2.4] - 2022-10-15Fixed an issue for not being able to correctly start batch process for meta transfer.[1.2.3] - 2022-10-15Fixed an issue for not being able to detect type list.[1.2.2] - 2022-10-15Fixed a minor issue for meta transfer not being able to properly loaded to the machine.[1.2.1] - 2022-10-15Fixed a minor issue for meta transfer not being able to properly loaded to the machine. (Fix did not work)[1.2.0] - 2022-10-15Addedmeta_transfer.batch_img_meta_transfer()for batch film digitizing workflow.[1.1.0] - 2022-10-15Addedmeta_transfer.img_meta_transfer()for easier film digitizing workflow.[1.0.0] - 2022-10-04First official release, with all the code cleaned up and properly documented.[0.1.4] - 2022-10-03Rewrote some of the old comments and docstring that doesn't make sense anymore.[0.1.3] - 2022-10-02Fixed minor bug where the log does not appear properly when transcoding multiple formats.[0.1.2] - 2022-10-02Renamedhe_jpg.pytohe_img.pyfor better file type support.Fixed a potential issue that can delete all JPG when using the oldheiya.he_jpg.[0.1.1] - 2022-10-02Wrote a more intuitiveREADEME.md, and updatedhaiya_demo.ipynbon Github.[0.1.0] - 2022-10-02Attempting to fix an issue of incorrect param call fromheiya.he_jpg.convert_jpg_to_he_jpg.[0.0.9] - 2022-10-02Unsuccessful fix for an issue of incorrect param call fromheiya.he_jpg.convert_jpg_to_he_jpg.[0.0.8] - 2022-10-02Standarized function names forfrom_heiandto_hei.[0.0.7] - 2022-10-02Fixed an issue of internal packages not being able to properly import.[0.0.6] - 2022-10-02Added extensions and tools to__init__.pyto fix referencing issue.[0.0.5] - 2022-10-02Removed the requirement forglob.[0.0.4] - 2022-10-02Removed the requirement foros.[0.0.3] - 2022-10-02Code cleanup.[0.0.2] - 2022-10-02Initial upload.[0.0.1] - 2022-10-01Created the project.