strukturag / libheif

libheif is an HEIF and AVIF file format decoder and encoder.
Other
1.76k stars 304 forks source link

examples: initial TIFF encoder support #1248

Closed bradh closed 3 months ago

bradh commented 4 months ago

Inspired by the TIFF decoder (and a cold wet morning), I've implemented a very basic TIFF encoder.

There are a lot more things we can do with TIFF over PNG/JPEG/Y4M. For example, it could do multiple images per file (instead of splitting them), different compression types and levels, different chroma or interleave formats etc. It could also do the various sample types (e.g. signed, float, etc), which is part of the reason for wanting it. None of that is done yet, partly because it will complicate the Encoder API and command line options.

I wonder if we should have only limited TIFF support for heif-dec, or whether to extend the Encoder API. Related, we could have HEIF as an output format (e.g. so you can pull in HEIC and output AVIF, or JPEG-2000, or uncompressed, or some other combination). Possibly that should be a different tool.

Thoughts?

farindk commented 3 months ago

I wonder if we should have only limited TIFF support for heif-dec, or whether to extend the Encoder API.

One way could be to extend the encoder API to support multiple images per file and have an Encoder_SingleImage class as the base for the existing formats that will split this up into multiple images.

Related, we could have HEIF as an output format (e.g. so you can pull in HEIC and output AVIF, or JPEG-2000, or uncompressed, or some other combination). Possibly that should be a different tool.

Sure. But at some point we might have to draw a line what is still the business of libheif and what should be handled by image convertion packages like ImageMagick. On the other hand, adding libheif as input or output format wouldn't be that difficult.