Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Use GraphicsMagick for HEIC conversion #363

Open
keybits opened this issue May 2, 2024 · 6 comments
Open

Use GraphicsMagick for HEIC conversion #363

keybits opened this issue May 2, 2024 · 6 comments
Labels
enhancement New feature or functionality

Comments

@keybits
Copy link

keybits commented May 2, 2024

GraphicsMagick now supports HEIC / HEIF: http://www.graphicsmagick.org/NEWS.html#march-26-2022

Would it be possible to update thumbsup so that ImageMagick is no longer required for converting that format?

@keybits keybits added the enhancement New feature or functionality label May 2, 2024
@keybits
Copy link
Author

keybits commented May 2, 2024

Perhaps this issue would be better in the downsize repo where this is discussed in the comments? https://github.com/thumbsup/downsize/blob/a5b60e31a023e692bafb4e5895fc51035672fd56/lib/image/heic.js#L7-L27

@rprieto
Copy link
Member

rprieto commented May 2, 2024

Hi, thank you for raising this. I'm open to it.
We'd have to run some tests (e.g. on the test images in the downsize repo) to check how GM compares to IM.
For example, do we still need the 3-pass approach (take first image, copy colour profile, convert to sRGB)?

@keybits
Copy link
Author

keybits commented May 3, 2024

Actually, I think I spoke to soon! I have the latest version on macOS via Homebrew. Even with libeheif installed, I get:

gm version
GraphicsMagick 1.3.43 2024-03-23 Q16 http://www.GraphicsMagick.org/
Copyright (C) 2002-2024 GraphicsMagick Group.
Additional copyrights and licenses apply to this software.
See http://www.GraphicsMagick.org/www/Copyright.html for details.

Feature Support:
  Native Thread Safe         yes
  Large Files (> 32 bit)     yes
  Large Memory (> 32 bit)    yes
  BZIP                       yes
  DPS                        no
  FlashPix                   no
  FreeType                   yes
  Ghostscript (Library)      no
  HEIF/HVEC ("HEIC")         no
  JBIG                       no
  JPEG-2000                  yes
  JPEG                       yes
  JPEG XL                    yes
  Little CMS                 yes
  Loadable Modules           yes
  Solaris mtmalloc           no
  Google perftools tcmalloc  no
  OpenMP                     no
  PNG                        yes
  TIFF                       yes
  TRIO                       no
  Solaris umem               no
  WebP                       yes
  WMF                        no
  X11                        no
  XML                        yes
  ZLIB                       yes

Host type: aarch64-apple-darwin23.4.0

I'm not sure how I'd get it to say 'yes' for HEIF/HVEC ("HEIC")

So this looks like it wouldn't be something that would work for most people yet.

@keybits
Copy link
Author

keybits commented May 3, 2024

Worked it out:

brew install --build-from-source graphicsmagick

The feature is then available if libeheif is installed.

I submitted a PR to Homebrew to get it enabled by default: Homebrew/homebrew-core#170697

@keybits
Copy link
Author

keybits commented May 3, 2024

The above PR has been merged, so macOS Homebrew users will now get HEIF/HVEC ("HEIC") support in GraphicsMagick by default.

@rprieto
Copy link
Member

rprieto commented May 3, 2024

Thank you for submitting this PR!I recommend that we keep an eye on other systems (Alpine, Debian, Windows) to see when GraphicsMagick has HEIC support by default across the board.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or functionality
Projects
None yet
Development

No branches or pull requests

2 participants