Comments (1)
More generally it would be good if we have a better way to treat "semantically meaningful" tail data when transcoding JPEG files. Besides these "MotionPhoto" cases, there is also UltraHDR (which has a gain map in the tail data) and MPF in general (Multi Picture Format) like some examples I've seen where the main image has fake bokeh applied to the background but the original image with a sharp background is still there in the tail data; also just a concatenation of JPEG files (which is something e.g. ffmpeg can ingest) could be seen as an example of this.
Currently tail data is stored in the jbrd
and just treated like any other "unknown" data, like unknown APP markers or padding bits: it simply gets Brotli-compressed and in that way it becomes "hidden" in the JXL file, in the sense that the only way to retrieve such info is to apply the JPEG bitstream reconstruction procedure first.
It would be cleaner if we would define some kind of recursive structure in the file format where there is an optional box, name TBD but for the purpose of discussion we could call it tail
, which contains the "tail data" of the main image. Then if the tail data is a movie, it could simply be copied into such a tail
box, but if the tail data is another JPEG bitstream, then JXL's JPEG bitstream recompression could be applied recursively to that tail JPEG, and the tail
box of the main image would then contain another JXL file. This could be nested arbitrarily deep, e.g. if you would concatenate three JPEGs then the third one would be in the tail
box of the JXL file corresponding to the second one, which would be in the tail
box of the first one.
Maybe instead of tail
it could be called next
or something. Such a structure would not allow seeking (it's a linked list, not a random access data structure), but for sequential access it would be fine. It would also make it straightforward to strip the tail data while still allowing reconstruction of the main image.
This method could also be used to extend the JXL file format to allow representing sequences of images that are coded completely independently (i.e. not as frames within a single JXL codestream), which can be useful since multi-frame single-codestream JXL has the limitation that all frames need to have the same dimensions and colorspace.
I am turning this issue into a discussion since this is not just a libjxl issue but changing anything here would require extending the spec (ISO/IEC 18181-2 in this case).
from libjxl.
Related Issues (20)
- Typos in color_encoding.h HOT 1
- Backslashes in released zip archives paths
- jpegli encoding failed for black png HOT 3
- a2x Syntax Error with .asdf/PyEnv HOT 1
- Trouble compiling on macos (Monterey 12.7.4)
- djpegli: Can't decompress an image HOT 3
- NEON_WITHOUT_AES test fails on armv7l-linux (0.10.2)
- Benchmark-xl producing different output depending on parameters called. SSIMULACRA2 missing when --print_details_csv used.
- JPEG LI drop-in replacement for the system library with the same name
- Failed to build main with skcms in msys2/clang64 HOT 9
- JPEGXL_STATIC fails to build on Fedora 40
- Bundled SSIMULACRA2 detects differences in losslessly converted JXL HOT 1
- DHT marker: no Huffman table found HOT 3
- Just curious why depends on libjpeg, can we use jpegli instead? HOT 1
- Undefined symbols for x86_64: `___cpu_model`
- YCbCr JPEG cannot be losslessly transcoded HOT 1
- Inconsistent default behavior for Jpegli HOT 2
- Unexpected marker 0xd3
- Excessive desaturation of vibrant colors
- deps.sh doesn't download GTest
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from libjxl.