-
-
Notifications
You must be signed in to change notification settings - Fork 1.3k
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
Enhancement: make compression property for heif output mandatory #3740
Comments
https://sharp.pixelplumbing.com/api-output#heif HEIF is a container, which supports HEVC and AV1 codecs used to create HEIC and AVIF images respectively. The documented default compression for the HEIF container is AV1, which was chosen as it is not patent encumbered and the prebuilt binaries support it.
Please can you ensure you are using the latest version of libvips, libheif and x265 and that they are configured correctly e.g. libheif might be setup to use a plugin system for its codecs. If you are still having problems please provide complete details about the environment, dependencies, code and sample images you are using that allows someone else to reproduce. A standalone repo with a Dockerfile might be suitable for this. |
Hi @lovell, To me it sounds super strange when i explicitly call My proposal would be to remove heif - and any reference to it - from your library and proceed with heic instead. The On my part however, I already was very reluctantly trying that because of the reasons mentioned in my first post. I wanted AVIF or very preferably JXL. The later isn't possible because there is no package for it in flutter that implements is. For avif however, there is: https://pub.dev/packages/flutter_avif (i didn't know, but i do now and am using it). So i have no more need for heic images. As my development work is already cram-packed, i'm not going to debug this library for a feature i don't need anymore. Sorry for that, you'll hopefully understand. I do happily keep using your awesome library for AVIF files though. And soon probably jxl too.:) |
The HEIF container supports a growing number of codecs, and conversely a growing number of new video codecs are selecting HEIF as their container for still images. Being based on ISOBMFF (née Quicktime) it's perhaps not the most efficient container but it's here to stay. Conceptually it's rather like TIFF. The specs for multi-frame HEIF and TIFF both allow different codecs per frame within the same file, although many encoders don't yet support this.
Would making the
How could the documentation be made clearer? |
Let's go with some mutually agreeable assumptions :) When using your library do you agree that:
If you agree with those assumptions then your defaults for heif are wrong. |
I guess the answers depend on the point in time. A reframed question might be: should an image using the HEIF container have a default A brief historical interlude:
Returning to now, in the world outside of sharp, the HEIF container continues to be adopted by further codecs. A good example that I think has potential is the patent-free MPEG5 EVC "baseline" profile. This is why I'm suggesting the removal of a default |
Sorry to be blunt here, but i couldn't care less about patents. I think they are destructive to software and should be nuked from existence. In my view if there is an open source library just publicly available then patents can go to.. well, you get my drift ;) I do get this view is harder to maintain if you're in the US, the patent system - and rights - is just wildly different there compared to here in the EU.
That would be a good change! For what it's worth. To make the joke complete, and effectively giving me a huge distaste for ever using that format, is that they seem to add in all the crappy garbage formats from the past in that "high efficiency" container. Like look at the spec: https://nokiatech.github.io/heif/technical.html they added JPEG, JPEG XR and even GIF is in there! If there's anything low efficiency it's GIF and they added it. Moreover a true - proven - superior image format would be JPEG XL (not XR), yet they thus far haven't added that one in. What a joke. |
v0.33.0 is now available with the mandatory |
Feature request
What are you trying to achieve?
Creating an HEIF thumbnail. It's surprisingly difficult!
When you searched for similar feature requests, what did you find that might be related?
There's a couple related issues like libvips (i have it), x265 (i have it) and aom ( i have it too). Still creating HEIF (or strictly HEIC) images isn't working at all.
What would you expect the API to look like?
...heif({ compression: 'hevc' }).toFile(...)
Should produce an image.
Without the compression flag, it creates an AVIF image (which is super confusing!).
With the compression flag it creates an empty file.
What alternatives have you considered?
So, i'm using these images in a mobile app.
I actually want JXL, but that support is very limited thanx to google blocking it.. so that's out of the question.
AVIF is fine too, but that support too is quite limited on mobile still.
Then HEIF is next. And that doesn't work in this library. So.. yay...
Please provide sample image(s) that help explain this feature
N/A, above should be clear.
With regard to HEIF support, could that please be hardened.
The mere fact that HEIF - by default, if you don't provide the compression flag - generates an AVIF image is extremely confusion. I'm sure there's a very good reason for doing this, but i don't see it. To me it seems like that feature shouldn't exist. Or spam the user with warnings that setup is chosen that will be confusion.
But other then that, clearly something isn't working yet there isn't a single error anywhere. It might nice to have a look at that and be a little error happy. :)
I'm using ArchLinux here and have no problem with HEIC images, that all works just fine.
Any clue on how to get this working?
The text was updated successfully, but these errors were encountered: