24.6 HEIC转JPG https://scz.617.cn/windows/202106222100.txt Q: issy 2021-06-22 21:00 Win10上如何查看HEIC文件?如何将HEIC文件转成JPG文件? D: 从iOS 11开始,iPhone拍照默认保存成HEIC格式,而不是JPG格式。据说HEIC图片尺 寸小于JPG,但前者兼容性极差,PC上很多软件不支持HEIC文件查看。 下面是iPhone上相关设置 -------------------------------------------------------------------------- Settings Camera Formats High Efficiency // HEIC Most Compatible // JPG Photos Transfer to Mac or PC Automatic // JPG Keep Originals // HEIC -------------------------------------------------------------------------- A: 假设iPhone已将"Transfer to Mac or PC"调成"Automatic",可以用微信从iPhone发 送HEIC图片到PC,再下载保存,这将得到JPG图片。 A: 有在线转换服务 HEIC to JPEG Free Online Converter https://heic.online/ 该网站一次最多可以上传100张HEIC图片,可以转换成JPG、PNP、BMP,支持删除EXIF 信息。 在线服务的坏处是不适合转换敏感图片,服务方会留存你上传的图片。 A: scz "Microsoft Store"中有一些软件可以查看、转换HEIC文件: -------------------------------------------------------------------------- Microsoft Store 搜索"HEIC" HEIC to JPEG (FREE) 免费版每天可以转10张图片,不能查看 HEIC Image Viewer, Converter (MagickViewer.exe) 可以查看HEIC文件,转换功能需要另外付费购买 HEIF 图像扩展 据说安装后可以让Win10的"照片"支持HEIC查看,但实测表明其依赖另一个扩 展"HEVC 视频扩展",后者需要付费购买 iMazing HEIC Converter 好像需要登录微软帐号才能使用?不能查看,只能转换,转换无限制 -------------------------------------------------------------------------- "iMazing HEIC Converter"可以打开单个文件,可以打开整个目录,转换前可以做些 简单设置: -------------------------------------------------------------------------- Format JPEG (默认) PNG Keep EXIF data 默认选中,清空它,不要选 Quality 默认95%,可以调成100%,图片质量越佳,文件尺寸越大 -------------------------------------------------------------------------- 实测一个287KB的HEIC文件,95%的JPG有756KB,100%的JPG有1350KB,HEIC果然省空 间。 A: scz Win10上推荐用这个 CopyTrans HEIC for Windows https://www.copytrans.net/copytransheic/ https://www.copytrans.net/bin/CopyTransHEICforWindowsv1.008.exe 安装"CopyTrans HEIC"时提示要卸载微软的HEIC组件,前述4个从"Microsoft Store" 安装的软件在"Microsoft Store"中看到的状态不再是"已安装";但并未真正卸载什 么,它们都在,也能用,而且在下面还能看到: -------------------------------------------------------------------------- 设置 系统 存储 应用和功能 应用 应用和功能 -------------------------------------------------------------------------- 我猜只是一些内部组件关联设置有变吧。 "CopyTrans HEIC"装完后,双击some.heic,将直接用传统的"Windows 照片查看器" 打开,选中some.heic,右键菜单有"Convert to JPEG with CopyTrans",直接在当 前目录下生成some.jpg。可以说查看、转换皆便利,个人使用时软件免费无限制。 A: scz Linux上有很多转换工具,在Debian上测试了其中一种 apt-file search bin/heif-convert aptitude install libheif-examples heif-convert some.heic some.jpg heif-convert some_1.heic some_1.jpg heif-convert some_5.heic some_5.jpg 批量改后缀: for file in *.heic; do mv "$file" "`echo $file | sed s/.heic/.HEIC/`"; done for file in *.HEIC; do mv "$file" "$(echo $file | sed s/.HEIC/.heic/)"; done 批量转换: for file in *.heic; do heif-convert $file ${file/%.heic/.jpg}; done Win10的WSL1中没有libheif-examples。 D: scz 2021-06-23 https://www.ffmpeg.org/ https://git.ffmpeg.org/ffmpeg.git https://github.com/FFmpeg/FFmpeg https://www.gyan.dev/ffmpeg/builds/ https://www.gyan.dev/ffmpeg/builds/ffmpeg-release-full.7z https://www.gyan.dev/ffmpeg/builds/packages/ffmpeg-4.4-full_build.7z https://github.com/BtbN/FFmpeg-Builds https://github.com/BtbN/FFmpeg-Builds/releases ffmpeg-n4.4-73-g7015704640-win64-gpl-4.4.zip apt-file update apt-file search bin/ffmpeg apt-get update -u aptitude install ffmpeg 有人说ffmpeg可以将HEIC文件转成JPG文件,但我实测未成功,参看: HEIF support https://trac.ffmpeg.org/ticket/6521 这里提供了5个HEIC文件,时至今日最新版ffmpeg仍无法成功转换: ffprobe -i some_1.heic ffmpeg -i some_1.heic some_1.jpg 报错: moov atom not found some_1.heic: Invalid data found when processing input 据说ffmpeg支持Nokia的HEIC文件,不支持Apple的。 D: scz 2021-06-23 https://github.com/monostream/tifig https://github.com/monostream/tifig/releases https://github.com/monostream/tifig/releases/download/0.2.2/tifig-static-0.2.2.tar.gz https://github.com/monostream/tifig/archive/refs/tags/0.2.3.tar.gz "tifig 0.2.2"有一个静态x64版本,可以在Win10的WSL1中直接使用: ./tifig -v -p some_1.heic some_1.jpg ./tifig some_5.heic some_5.jpg 据说"tifig 0.2.2"只支持iOS 11生成的HEIC文件,不支持较新的HEIC文件: ./tifig some.heic some.jpg 报错: Grid configuration not found! tifig currently only supports .heic images created on iOS 11 devices. If you are certain this image was created on iOS 11, please open an issue here: https://github.com/monostream/tifig/issues/new 不知道"tifig 0.2.3"是否支持较新的HEIC文件?看它说明是: Complete conversion (with warning) even if EXIF data is missing "tifig 0.2.3"没有现成的静态版本,我懒得编译源码再测试。