JPEG XL

Info

rules 58
github 38692
reddit 688

JPEG XL

jxl-rs 0
tools 4270
website 1813
adoption 22069
image-compression-forum 0
glitch-art 1071

General chat

welcome 3957
introduce-yourself 294
color 1687
photography 3532
other-codecs 25116
on-topic 26652
off-topic 23987

Voice Channels

General 2578

Archived

bot-spam 4577

jxl

Anything JPEG XL related

jonnyawsom3
2024-12-03 03:59:33
I can't wait to crash my phone viewing it again
CrushedAsian255
2024-12-03 07:19:41
AV1 is for normies, embrace Motion JXL
DZgas Ж 3 fps shrek 10 mb will be ready tomorrow
2024-12-03 07:20:05
using inter-frame copy?
2024-12-03 07:20:16
how would it work with seeking? does it have to decode the entire file for each frame?
DZgas Ж
CrushedAsian255 using inter-frame copy?
2024-12-03 08:52:09
block skiping
CrushedAsian255 how would it work with seeking? does it have to decode the entire file for each frame?
2024-12-03 08:55:14
no, decoding of all frames need. JXL don't have keyframes, although I can make it, for example, every 500 frames. only there's no way to mark it. therefore, it is necessary to decode the entire file
CrushedAsian255
DZgas Ж no, decoding of all frames need. JXL don't have keyframes, although I can make it, for example, every 500 frames. only there's no way to mark it. therefore, it is necessary to decode the entire file
2024-12-03 11:58:10
> although I can make it, for example, every 500 frames You could implement pseudo-scene detection by saying if, say, 75% or more blocks are new and a keyframe hasn't happened in the last few frames, or a keyframe hasn't happend for the last 3 00 or whatever frames, then it should be a keyframe > only there's no way to mark it. therefore, it is necessary to decode the entire file The `jxli` box lets you list an index of frames, the frames listed are seekable keyframes
2024-12-03 11:59:12
DZgas Ж
CrushedAsian255 > although I can make it, for example, every 500 frames You could implement pseudo-scene detection by saying if, say, 75% or more blocks are new and a keyframe hasn't happened in the last few frames, or a keyframe hasn't happend for the last 3 00 or whatever frames, then it should be a keyframe > only there's no way to mark it. therefore, it is necessary to decode the entire file The `jxli` box lets you list an index of frames, the frames listed are seekable keyframes
2024-12-03 01:00:38
when the scene changes, the all blocks update I don't need to search for a keyframe, I just need to mark those frames in which 100% of the blocks have changed. but how? jxli is what?
CrushedAsian255
DZgas Ж when the scene changes, the all blocks update I don't need to search for a keyframe, I just need to mark those frames in which 100% of the blocks have changed. but how? jxli is what?
2024-12-03 01:18:46
> I don’t need to search for a key frame I’m thinking more like if all but 4 blocks update it’s probably worth it making the entire frame a key frame instead of trying to reuse those 4 blocks (it would also allow predictors to probably work better as it has the whole context) > jxli is what? The jxli box is a seek table, like the one found in FLAC files. It lists the offsets (bytes and time) of frames that can be reliably seeked to, ie key frames. Look at the screenshot file I sent for the specific implementation of it
DZgas Ж
CrushedAsian255 > I don’t need to search for a key frame I’m thinking more like if all but 4 blocks update it’s probably worth it making the entire frame a key frame instead of trying to reuse those 4 blocks (it would also allow predictors to probably work better as it has the whole context) > jxli is what? The jxli box is a seek table, like the one found in FLAC files. It lists the offsets (bytes and time) of frames that can be reliably seeked to, ie key frames. Look at the screenshot file I sent for the specific implementation of it
2024-12-03 01:29:22
No. firstly, I'm not at home right now and no one has answered whether there is a jpeg xl decoder for android with animation support. There doesn't seem to be one. Not exist? Second, I did not understand the principle. I have a ready-made jpeg xl animation and a list of frames that are marked as key. How do I work with this? what should be done and where? which software should I use?
CrushedAsian255
2024-12-03 01:31:14
Not sure about the first question as I don’t use android. For the second one, I’m not sure if any such software exists, you might have to write it yourself. You would just have to find each of those frame’s offsets into the JXL code steam (NOT the entire file) and write the bytes as the spec says to
DZgas Ж
CrushedAsian255 Not sure about the first question as I don’t use android. For the second one, I’m not sure if any such software exists, you might have to write it yourself. You would just have to find each of those frame’s offsets into the JXL code steam (NOT the entire file) and write the bytes as the spec says to
2024-12-03 01:33:13
if there is no such software. then why should exist software that can work with this for playback from keyframes?
CrushedAsian255
2024-12-03 01:34:40
I don’t think any software as of this time actually uses the index but it’s nice to have and could be implemented in other software if/when JXL mass adoption occurs
2024-12-03 01:35:35
I think having occasional keyframes is good even not for just specifically seeking but for memory efficiency as it doesn’t have to keep storing old frames
2024-12-03 01:35:50
Unless libjxl is either way smarter or dumber than i thought
DZgas Ж
CrushedAsian255 I think having occasional keyframes is good even not for just specifically seeking but for memory efficiency as it doesn’t have to keep storing old frames
2024-12-03 01:39:49
I will not be programming the format itself, my work is outside the field of libjxl itself. I give it an apng and get the result until such functionality is added to libjxl, I will not do this mpv can't do key play, ffplay can't either. xnview is not working properly. and there is no software for android at all. I will not waste my strength on this. in addition, it is possible to do this by post-processing when the animation is already fully ready, comparing the past and current frame until there is a pixel change in the entire image. in general, let someone else do it. I'm interested in something more relevant.
2024-12-03 01:40:49
considering that I haven't even found a normal software to create such an apng with an overlay. to wait for such people for another 5 years
2024-12-03 01:41:06
<:Xjxl:822166843313225758>
DZgas Ж full Shrek in 10 Mb jpeg xl
2024-12-03 09:15:51
finally, the algorithm I wrote for skipping blocks saves about 30% of size. Shrek is now at 3 fps instead of 2 fps <:JXL:805850130203934781><:jxl:1300131149867126814><:Stonks:806137886726553651><:Xjxl:822166843313225758><:logo:829708783336816671><:pancakexl:1283670260209156128>
2024-12-03 09:17:14
CrushedAsian255
2024-12-03 09:52:28
just wondering what are the frames that are completely black?
DZgas Ж
CrushedAsian255 just wondering what are the frames that are completely black?
2024-12-03 09:55:21
for some reason, Windows displays frames with zero transparency in this way. this is RGBA 0 0 0 0
CrushedAsian255
2024-12-03 09:56:00
so those frames are effectively skip frames?
DZgas Ж
CrushedAsian255 so those frames are effectively skip frames?
2024-12-03 09:57:54
yes, empty frames are skipped
2024-12-03 10:01:46
This is one of my last things that I did all day so that the frame would not be updated in parts if there were no updates, but would transfer the changes to the next frame. So I saved a lot if the frame moves a little, but entirely
2024-12-03 10:02:04
global camera movement
A homosapien
2024-12-03 11:08:45
Behold, the first episode of The Amazing Digital Circus in a JXL. -e 5 -d 14.1 @ 2 fps speed up 50%.
Traneptora
2024-12-04 12:51:23
``` leo@gauss ~/Development/ffmpeg-devel/ffmpeg :) $ ./ffmpeg_g -y -i ~/Videos/test-clips/lossless-out.mkv -c libjxl_anim -f image2pipe ../test-images/bbb.jxl ffmpeg version N-117995-g56419fd096 Copyright (c) 2000-2024 the FFmpeg developers built with gcc 14.2.1 (GCC) 20240910 configuration: --disable-doc --disable-stripping --assert-level=2 --enable-libjxl libavutil 59. 47.101 / 59. 47.101 libavcodec 61. 27.100 / 61. 27.100 libavformat 61. 9.100 / 61. 9.100 libavdevice 61. 4.100 / 61. 4.100 libavfilter 10. 6.101 / 10. 6.101 libswscale 8. 12.100 / 8. 12.100 libswresample 5. 4.100 / 5. 4.100 Input #0, matroska,webm, from '/home/leo/Videos/test-clips/lossless-out.mkv': Metadata: title : Big Buck Bunny, Sunflower version COMMENT : Creative Commons Attribution 3.0 - http://bbb3d.renderfarming.net GENRE : Animation MAJOR_BRAND : isom MINOR_VERSION : 1 COMPATIBLE_BRANDS: isomavc1 COMPOSER : Sacha Goedegebure ARTIST : Blender Foundation 2008, Janus Bager Kristensen 2013 ENCODER : Lavf60.7.100 Duration: 00:00:04.00, start: 0.000000, bitrate: 35329 kb/s Stream #0:0: Video: vp9 (Profile 0), yuv420p(pc, bt709, progressive), 1280x720, SAR 1:1 DAR 16:9, 30 fps, 30 tbr, 1k tbn (default) Metadata: HANDLER_NAME : GPAC ISO Video Handler VENDOR_ID : [0][0][0][0] ENCODER : Lavc60.20.100 libvpx-vp9 DURATION : 00:00:04.000000000 Stream mapping: Stream #0:0 -> #0:0 (vp9 (native) -> jpegxl_anim (libjxl_anim)) Press [q] to stop, [?] for help Output #0, image2pipe, to '../test-images/bbb.jxl': Metadata: title : Big Buck Bunny, Sunflower version COMMENT : Creative Commons Attribution 3.0 - http://bbb3d.renderfarming.net GENRE : Animation MAJOR_BRAND : isom MINOR_VERSION : 1 COMPATIBLE_BRANDS: isomavc1 COMPOSER : Sacha Goedegebure ARTIST : Blender Foundation 2008, Janus Bager Kristensen 2013 encoder : Lavf61.9.100 Stream #0:0: Video: jpegxl_anim, rgb24(pc, gbr/bt709/bt709, progressive), 1280x720 [SAR 1:1 DAR 16:9], q=2-31, 200 kb/s, 30 fps, 30 tbn (default) Metadata: encoder : Lavc61.27.100 libjxl_anim HANDLER_NAME : GPAC ISO Video Handler VENDOR_ID : [0][0][0][0] DURATION : 00:00:04.000000000 [out#0/image2pipe @ 0x5c1569001500] video:12944KiB audio:0KiB subtitle:0KiB other streams:0KiB global headers:0KiB muxing overhead: 0.000000% frame= 120 fps=5.2 q=-0.0 Lsize= 12944KiB time=00:00:04.00 bitrate=26509.9kbits/s speed=0.172x leo@gauss ~/Development/ffmpeg-devel/ffmpeg :) $ jxlinfo -v ../test-images/bbb.jxl JPEG XL animation, 1280x720, lossy, 8-bit RGB num_color_channels: 3 num_extra_channels: 0 have_preview: 0 have_animation: 1 ticks per second (numerator / denominator): 30 / 1 num_loops: 0 have_timecodes: 0 Intrinsic dimensions: 1280x720 Orientation: 1 (Normal) Color space: RGB, D65, sRGB primaries, 709 transfer function, rendering intent: Relative frame: full image size, duration: 33.3 ms ``` <:PauseChamp:755852977574510632>
2024-12-04 12:52:39
libjxl_anim coming soon
DZgas Ж
A homosapien Behold, the first episode of The Amazing Digital Circus in a JXL. -e 5 -d 14.1 @ 2 fps speed up 50%.
2024-12-04 01:44:59
<:megapog:816773962884972565>
2024-12-04 01:49:06
tomorrow I will post my algorithm for compressing animation by updating jpeg xl blocks. with use instructions. I must say right away that I did the calibration of the entire algorithm for 128x64 and 3 fps. Therefore, you will most likely have to do a large recalibration of values for different sizes and frame rates. And it's also python code that's half written in a neural network, well, that's so that you know
2024-12-04 01:50:34
in fact, I've done more than 2000 parameter iterations comparing the resulting size of the jpeg xl file after full compression. And the pixel difference of the resulting image compared to the original.
2024-12-04 01:53:59
Here is the code that takes PNG files from a folder and encodes the APNG in frame-overlap-frame mode. Using python pillow. PngImagePlugin.Blend.OP_OVER aka APNG_BLEND_OP_OVER
A homosapien Behold, the first episode of The Amazing Digital Circus in a JXL. -e 5 -d 14.1 @ 2 fps speed up 50%.
2024-12-04 03:08:56
128x64 3 fps -d 1.7
2024-12-04 03:09:00
2024-12-04 03:11:41
wait..... what the 422 on all apng output 💀
2024-12-04 03:15:36
ffmpeg input vp9 yuv420p output png, rgb24 but is not <:NotLikeThis:805132742819053610>
2024-12-04 03:18:40
another day when software that is used by hundreds of thousands of people does perfect bullshit because it is broken
2024-12-04 03:25:33
fuck png now i use jpeg (because for some reason RGB output does work like 4:2:2 in FFMPEG 7.0.2 but jpeg yuvj444p works well) - considering that the result will still be much more compressed in jxl, I think this is not so important
jonnyawsom3
2024-12-04 03:50:10
Compress with jpegli in low quality and then recompress with jxl for 20% smaller <:galaxybrain:821831336372338729>
2024-12-04 03:50:19
No blurryness
DZgas Ж
Compress with jpegli in low quality and then recompress with jxl for 20% smaller <:galaxybrain:821831336372338729>
2024-12-04 03:52:14
<:Poggers:805392625934663710> jpeg with alpha channel
2024-12-04 03:53:49
in any case, this is a good reason to add the input option for jpeg and webp before the release
DZgas Ж 128x64 3 fps -d 1.7
2024-12-04 03:55:40
fixed
CrushedAsian255
2024-12-04 04:06:41
Could we just take the Jpegli encoder as JXL lower effort ?
DZgas Ж
CrushedAsian255 Could we just take the Jpegli encoder as JXL lower effort ?
2024-12-04 04:21:55
but classic jpeg is -e 3
Traneptora
CrushedAsian255 Could we just take the Jpegli encoder as JXL lower effort ?
2024-12-04 04:24:11
jpegli is basically e3 without xyb
jonnyawsom3
2024-12-04 04:44:23
Could probably make e1 and e2 'JPEG Compatible' like was mentioned long ago, allowing decoding to a regular JPEG without futher loss
CrushedAsian255
Could probably make e1 and e2 'JPEG Compatible' like was mentioned long ago, allowing decoding to a regular JPEG without futher loss
2024-12-04 04:55:24
So literally just jpegli > cjxl?
jonnyawsom3
2024-12-04 05:02:29
Pretty much, an old idea was having JXL files that only use JPEG compatible features, so you can transcode back on the fly at the highest quality
CrushedAsian255
2024-12-04 08:27:15
Maybe have JXLs that are mostly JPEG transcode able but have very slight EPF or Gaborish so they look slightly better as JXL then JPEG
veluca
Traneptora jpegli is basically e3 without xyb
2024-12-04 09:59:01
not sure about that, IIRC jpegli does adaptive quantization that e3 doesn't
Traneptora
veluca not sure about that, IIRC jpegli does adaptive quantization that e3 doesn't
2024-12-04 01:32:50
ah nvm then
DZgas Ж
DZgas Ж tomorrow I will post my algorithm for compressing animation by updating jpeg xl blocks. with use instructions. I must say right away that I did the calibration of the entire algorithm for 128x64 and 3 fps. Therefore, you will most likely have to do a large recalibration of values for different sizes and frame rates. And it's also python code that's half written in a neural network, well, that's so that you know
2024-12-04 02:47:55
I don't seem to have anything else to add to my code, and since it's unlikely that anyone needs it anywhere, I'll post the sources Only here as soon as I run the compression cycle for the last time and make sure it works
2024-12-04 02:50:49
I hope there are normal python programmers here exist
2024-12-04 07:08:59
When creating live wallpapers, it turned out that Saving PNG requires all uncompressed images in memory, for 1920x1080 it came out to about 5 gigabytes per 300 frames. The cjxl has the same requirements, but slightly lower
2024-12-04 07:12:22
moreover, the processor load when decoding jpeg xl 1080p animation is greater than if it were AV1 1080p yuv444 10 bit <@853026420792360980>
2024-12-04 07:12:48
ffplay refused to decode it as animation, it works in MPV
Traneptora
DZgas Ж moreover, the processor load when decoding jpeg xl 1080p animation is greater than if it were AV1 1080p yuv444 10 bit <@853026420792360980>
2024-12-04 07:13:43
sounds like proper video codecs are better at video
2024-12-04 07:14:01
do you have a (small) sample that ffplay refused to decode but mpv played fine?
DZgas Ж
2024-12-04 09:04:30
perfectly
Traneptora sounds like proper video codecs are better at video
2024-12-04 09:05:05
Yes, I was just able to do that
2024-12-04 09:06:30
late I realized that I should have done a larger block size analysis
2024-12-04 09:06:36
so well
Traneptora
2024-12-04 09:10:18
so I believe ffplay is failing because the video stream isn't able to be decoded in realtime
2024-12-04 09:10:22
and mpv is able to handle that better
DZgas Ж
2024-12-04 09:12:28
VIDEO to Jpeg XL ``` 1. create folders input_images output_images 2. ffmpeg -i input_video.mkv -vf "fps=3,zscale=w=128:h=-2:filter=spline16,crop=128:64,format=gbrp" "input_images/frame%05d.png" 3. pip install pillow 4. python shrek-to-jxl_v1.0.py 5. python APNG-BLEND.py 6. cjxl -e 7 -d 2 APNG.apng output.jxl ```
Traneptora
2024-12-04 09:12:56
why not just us apngasm
DZgas Ж
DZgas Ж Well, he invented JVC <:logo:829708783336816671>
2024-12-04 09:13:27
<:JXL:805850130203934781> Jpegxl Video Codec release
Traneptora
2024-12-04 09:14:14
not sure why you're splitting the input into jpeg frames
CrushedAsian255
DZgas Ж fuck png now i use jpeg (because for some reason RGB output does work like 4:2:2 in FFMPEG 7.0.2 but jpeg yuvj444p works well) - considering that the result will still be much more compressed in jxl, I think this is not so important
2024-12-04 09:16:04
I think this
DZgas Ж
Traneptora why not just us apngasm
2024-12-04 09:16:19
laziness. Besides, I'm python enjoyer and I understand how to do it the way I did. I think you can write a script yourself to use apngasm because everything works in stages
Traneptora not sure why you're splitting the input into jpeg frames
2024-12-04 09:17:21
I found a bug yesterday. ffmpeg converts RGB png in 4:2:2 sampling format
2024-12-04 09:17:41
so https://discord.com/channels/794206087879852103/794206170445119489/1313707744204951563
Traneptora
DZgas Ж I found a bug yesterday. ffmpeg converts RGB png in 4:2:2 sampling format
2024-12-04 09:18:57
huh? what are you talking about
2024-12-04 09:19:16
you can't have 4:2:2 subsampling for RGB
DZgas Ж
Traneptora you can't have 4:2:2 subsampling for RGB
2024-12-04 09:21:30
``ffmpeg.exe -ss 1:00 -i "D:\MURDER DRONES\THE AMAZING DIGITAL CIRCUS: PILOT [HwAPLk_sQ3w].webm" -vf "scale=128:-1:flags=spline+full_chroma_inp,crop=128:64" OUT.png``
2024-12-04 09:22:11
Traneptora huh? what are you talking about
2024-12-04 09:22:26
yet I get
Traneptora
2024-12-04 09:23:01
because you're telling it that you have full chroma input and it doesn't
DZgas Ж
Traneptora because you're telling it that you have full chroma input and it doesn't
2024-12-04 09:23:26
i telling where?
Traneptora
2024-12-04 09:23:44
the flag `full_chroma_inp` tells libswscale that you're using full chroma input
2024-12-04 09:23:50
but the input doesn't have full chroma
2024-12-04 09:23:56
remove that flag
DZgas Ж
Traneptora but the input doesn't have full chroma
2024-12-04 09:25:18
But it doesn't matter.
Traneptora the flag `full_chroma_inp` tells libswscale that you're using full chroma input
2024-12-04 09:26:00
what kind of place should the 422 format make it? yes, even logically. Of course, I checked it yesterday, it gives the same result. FFMPEG is just broken
Traneptora
2024-12-04 09:26:21
there shouldn't be 4:2:2 anywhere
2024-12-04 09:26:24
FFmpeg isn't "just broken"
2024-12-04 09:26:29
what version are you even using
DZgas Ж
2024-12-04 09:26:42
7.0.2
Traneptora
2024-12-04 09:26:52
can you provide a sample that fails?
DZgas Ж
Traneptora can you provide a sample that fails?
2024-12-04 09:27:27
sample of what?
2024-12-04 09:27:36
any image?
Traneptora
2024-12-04 09:27:39
a sample file and command line that doesn't do what it's supposed to
2024-12-04 09:27:46
when you operate on that file
2024-12-04 09:27:58
and the full, uncut output of the command
2024-12-04 09:28:24
because the PNG encoder doesn't do anything "4:2:2" related, because it's just an encoder
2024-12-04 09:28:30
and switching to jpeg won't fix that
DZgas Ж
2024-12-04 09:28:36
i use https://www.gyan.dev/ffmpeg/builds/packages/ffmpeg-7.0.2-full_build.7z from https://www.gyan.dev/ffmpeg/builds/ for windows
Traneptora
2024-12-04 09:28:45
okay, but can you provide a sample file
2024-12-04 09:28:57
because I cannot reproduce what you are describing
DZgas Ж
Traneptora okay, but can you provide a sample file
2024-12-04 09:29:34
Okay now. Wait a minute. I'll find an old ffmpeg to extract the sample
Traneptora
2024-12-04 09:29:44
because "out.png" doesn't have subsampled chroma
2024-12-04 09:29:45
it's a PNG
2024-12-04 09:29:49
it can't have subsampled chroma
DZgas Ж
Traneptora it can't have subsampled chroma
2024-12-04 09:31:35
But wait. are you talking about the file that shows the color?
Traneptora
2024-12-04 09:31:51
no, I'm talking about `OUT.png` that you posted
2024-12-04 09:31:56
it isn't subsampled. PNG doesn't support subsampling.
2024-12-04 09:31:59
end of discussion.
DZgas Ж
Traneptora it isn't subsampled. PNG doesn't support subsampling.
2024-12-04 09:32:24
because obviously the error is happening with ffmpeg
Traneptora
2024-12-04 09:32:28
there's no error
2024-12-04 09:32:39
if you think that the PNG encoder is converting RGB to and then to 4:4:4 to 4:2:2 and then converting back to 4:4:4 and then back to RGB then
2024-12-04 09:32:44
well I don't know what you think is happening
2024-12-04 09:32:46
but that is not happening
DZgas Ж
2024-12-04 09:33:29
I have bad news, ffmpeg had the same error six months ago
Traneptora
2024-12-04 09:33:36
there is no error
2024-12-04 09:33:40
I don't know why you think there is an error
DZgas Ж
2024-12-04 09:34:05
ok go <#794206087879852106>
DZgas Ж VIDEO to Jpeg XL ``` 1. create folders input_images output_images 2. ffmpeg -i input_video.mkv -vf "fps=3,zscale=w=128:h=-2:filter=spline16,crop=128:64,format=gbrp" "input_images/frame%05d.png" 3. pip install pillow 4. python shrek-to-jxl_v1.0.py 5. python APNG-BLEND.py 6. cjxl -e 7 -d 2 APNG.apng output.jxl ```
2024-12-04 09:34:42
I posted my code to create the jxl animation, but no one will see it now <:PepeHands:808829977608323112>
DZgas Ж VIDEO to Jpeg XL ``` 1. create folders input_images output_images 2. ffmpeg -i input_video.mkv -vf "fps=3,zscale=w=128:h=-2:filter=spline16,crop=128:64,format=gbrp" "input_images/frame%05d.png" 3. pip install pillow 4. python shrek-to-jxl_v1.0.py 5. python APNG-BLEND.py 6. cjxl -e 7 -d 2 APNG.apng output.jxl ```
2024-12-05 06:20:32
color fix
CrushedAsian255
2024-12-06 11:41:21
`-e 11` go brr
2024-12-07 02:03:00
<@226977230121598977> does your code work on images other than 128:64?
2024-12-07 02:12:11
im running it on a 640:360 24fps animation just to see what happens
DZgas Ж
CrushedAsian255 im running it on a 640:360 24fps animation just to see what happens
2024-12-07 05:13:32
Yes, of course
CrushedAsian255 <@226977230121598977> does your code work on images other than 128:64?
2024-12-07 05:15:26
the problem is only in determining the limits like skipping frames from the level of changes or visually sufficient changes to change frames. It all requires testing output with the original. To understand which parameters are better, I made comparisons of 2000 combinations of parameters over days
DZgas Ж Yes, I was just able to do that
2024-12-07 05:16:40
but it also works
CrushedAsian255
2024-12-07 07:11:33
256x144 @ 24fps
nol
2024-12-09 04:43:31
Is there a recent version of the specification available here? The latest I can find is https://discord.com/channels/794206087879852103/1021189485960114198/1169087534060556339 from a year ago
TheBigBadBoy - 𝙸𝚛
2024-12-09 05:40:14
iirc once some guy created a discord account just to share that spec freely (?)
A homosapien
nol Is there a recent version of the specification available here? The latest I can find is https://discord.com/channels/794206087879852103/1021189485960114198/1169087534060556339 from a year ago
2024-12-09 05:55:03
https://discord.com/channels/794206087879852103/794206170445119489/1288880183603888304 And there is a newer draft here: https://discord.com/channels/794206087879852103/1021189485960114198/1256224842894540831
Traneptora
2024-12-10 04:31:56
why would there be a two DHT scans in a row?
2024-12-10 04:32:20
``` STRUCTURE OF JPEG FILE: cover.jpg address | marker | length | data 0 | 0xffd8 SOI 2 | 0xffe0 APP0 | 16 | JFIF......... 20 | 0xffdb DQT | 67 89 | 0xffdb DQT | 67 158 | 0xffc2 SOF2 | 17 177 | 0xffc4 DHT | 28 207 | 0xffc4 DHT | 24 233 | 0xffda SOS ``` e.g.
2024-12-10 04:32:54
likewise, two different DQTs
CrushedAsian255
2024-12-10 04:33:09
Different Huffman trees
Traneptora
2024-12-10 04:33:15
ye, but why would there be two of them?
CrushedAsian255
2024-12-10 04:33:19
Software was probably not smart enough to join them together
Traneptora
2024-12-10 04:33:28
it was jpegtran that just created this
Tirr
2024-12-10 04:33:33
some encoders seem to emit separate markers for each table
CrushedAsian255
2024-12-10 04:34:02
Some encoders like to waste 2 bytes
Traneptora
2024-12-10 04:34:41
is it actually just a 2byte waste?
Tirr
2024-12-10 04:35:16
maybe there are some compatibility concerns, idk
CrushedAsian255
2024-12-10 04:35:42
When were multi lane highways added to the JPEG spec?
2024-12-10 04:35:51
Multiple Huffman trees*
2024-12-10 04:36:02
Too much urban planning chat
A homosapien
2024-12-10 04:46:13
Is this related to duplicate quant tables not being removed? There are no current programs exist that can detect and strip it out iirc.
2024-12-10 04:46:32
Found the convo: https://discord.com/channels/794206087879852103/805176455658733570/1270873751021682841
Traneptora
2024-12-10 04:47:48
unrelated, I'm just curious because I found one in the wild like so
A homosapien
2024-12-10 04:50:47
there are a lot of weird jpegs out in the wild
Traneptora
2024-12-10 04:51:03
ye but this one was created by turbojpeg's jpegtran
2024-12-10 04:51:06
is why I was confused
A homosapien
2024-12-10 04:51:48
have you tried mozjpeg's jpegtran?
Traneptora
2024-12-10 04:52:33
not yet
2024-12-10 04:52:40
/usr/bin/jpegtran is libjpeg-turbo on my system
2024-12-10 04:53:06
I can't replace the system libjpeg with mozjpeg yet (or jpegli) because on arch there's some new functions used that make certain things (e.g. libtiff) fail
A homosapien
2024-12-10 04:54:19
i see
2024-12-10 04:54:31
well post the results when you can
Tirr
2024-12-10 04:54:32
my imagemagick does the same thing, maybe it's libjpeg-turbo
Traneptora
2024-12-10 04:54:55
looks like mozjpeg probably doesn't
2024-12-10 04:55:09
there is a python library that takes a bytes() object and uses it to optimize a jpeg using mozjpeg
2024-12-10 04:55:16
and I wrote a stupid garbo wrapper for it
2024-12-10 04:55:19
```sh #!/bin/sh for arg; do if [ -r "$arg" ] && [ -w "$arg" ]; then if [ "$(file --brief --mime-type "$arg")" = "image/jpeg" ] ; then slurp <"$arg" | python3 -c 'from mozjpeg_lossless_optimization import optimize; import sys; sys.stdout.buffer.write(optimize(sys.stdin.buffer.read()))' | slurp "$arg" else printf >&2 '%s: %s: not a jpeg\n' "${0##*/}" "$arg" fi fi done ```
2024-12-10 04:55:48
slurp is a C program I wrote
2024-12-10 04:55:50
yes we're doing this
2024-12-10 04:56:03
https://0x0.st/XhfE.c/slurp.c
2024-12-10 04:56:55
probably it's leaky
2024-12-10 04:56:57
¯\_(ツ)_/¯
2024-12-10 04:57:24
slurp reads in from stdin in full until EOF, and *then* it opens the output for writing, which is either stdout or the first argument
2024-12-10 04:57:57
so if you run `slurp <file | some_filter | slurp file` it slurps the entire thing in, sends it through the filter, and then when the second slurp sees EOF it writes it back
2024-12-10 04:58:18
allows you to do things like in-place-editing if the thing doesn't provide it
2024-12-10 04:58:22
without temp files
A homosapien
2024-12-10 05:07:16
cool, can you do this with jpeg xl or any supported image format I imagine?
_wb_
CrushedAsian255 Multiple Huffman trees*
2024-12-10 08:21:34
IIRC there's a huffman table for the DC coeffs and another one for the AC coeffs, and you can define them in two separate DHT markers if you want
CrushedAsian255
2024-12-10 08:22:04
Like how Luna and chroma get different DQTs sometimes?
_wb_
2024-12-10 08:22:39
same with quant tables, you can have up to 4 of those (you can use a different one for each component, if you want), and you can choose whether to put them all in one DQT marker or to use multiple markers
Salty
2024-12-10 10:20:00
Is there a known way to estimate the size of JPEG XL output given width, height, bit depth and the quality value?
CrushedAsian255
2024-12-10 10:29:54
It would depend on the content as well
2024-12-10 10:30:07
You could get a rough BPP and multiply by width*height but that’s
Salty
2024-12-10 10:30:44
Thinking about something akin to the preview here when saving a JPEG in Photoshop
CrushedAsian255 You could get a rough BPP and multiply by width*height but that’s
2024-12-10 10:31:38
<:monkaHmmm:738585281061453936> ic
A homosapien
Salty Thinking about something akin to the preview here when saving a JPEG in Photoshop
2024-12-10 10:35:02
Doesn't that just encode the image and read the file size?
Salty
2024-12-10 10:35:25
I'm not completely sure but I don't think doing that with JXL is feasible <:peepothink:715229420838846466>
2024-12-10 10:35:37
or maybe it is
2024-12-10 10:35:57
more like its a pain <:cutegiggle:758819454518951936>
jonnyawsom3
2024-12-10 10:36:12
I know ImageToolbox on mobile has some kind of filesize estimation too, where it adjusts once the file is finished encoding, though it acts... Strangely....
A homosapien
2024-12-10 10:37:39
I mean, you could encode at effort 1. The BPP from that is pretty close to higher efforts
2024-12-10 10:37:54
That could work as a "preview" mode
jonnyawsom3
2024-12-10 10:38:16
Could also downscale the image and then multiply the bpp back for a rough estimate
2024-12-10 10:38:42
Since e1 is only a lossless thing, lossy is still the same as e3
A homosapien
2024-12-10 10:40:41
I don't know if downscaling is a good idea. The internal metrics in jxl might overly deviate depending on the downscaler used.
2024-12-10 10:41:01
Due to how context-sensitive Jpeg XL is, I'm not sure how consistent that would be
jonnyawsom3
2024-12-10 10:41:59
Fair point, especially with noise and fine detail in the image that vastly increase filesize
A homosapien
2024-12-10 10:42:16
I think effort 1 is fast enough tbh
CrushedAsian255
2024-12-10 10:42:31
Does egg 1 even do anything for lossy
2024-12-10 10:42:43
I guess maybe the internal modular bitstream?
2024-12-10 10:43:08
Actually yeah what effort do the internal modular bitstreams use?
A homosapien
2024-12-10 10:43:15
Effort 1 is the same as effort 2 for lossy
2024-12-10 10:43:46
There was talk about implementing a super fast lossy mode iirc
2024-12-10 10:43:59
Similar to fast lossless
CrushedAsian255
2024-12-10 10:44:09
Can lossy lossless modular speed?
A homosapien
2024-12-10 10:45:04
I like your funny words magic man
2024-12-10 11:07:40
Found it: https://discord.com/channels/794206087879852103/794206170445119489/1297608882444701728
Salty
2024-12-10 05:29:31
Am I understanding correctly that if I have a recompressed JPEG file that I want to edit I would need to edit it as JPEG, save as JPEG then recompress again?
2024-12-10 05:30:39
otherwise I would either save it as lossless JXL which would go from lossy -> lossless and increase the size a bunch or just save as lossy jxl
username
2024-12-10 05:35:12
what specifically do you mean by editing a JPEG? do you mean purely lossless operations with special tools that don't involve decoding the JPEG into pixels such as cropping, converting to grayscale, or editing metadata? or do you mean like decoding the JPEG to pixels and then editing it?
Salty
2024-12-10 05:35:32
decoding jpeg to pixels, editing it
2024-12-10 05:35:37
lossy to lossy
Oleksii Matiash
2024-12-10 05:35:43
Then just save it as lossy jxl
Salty
2024-12-10 05:36:10
I guess I can do that <:yep:772595738391740426>
monad
2024-12-11 12:31:35
Assuming your editing software supports JXL, it's also better to decode the JXL directly rather than reconstructing a JPEG.
Traneptora
A homosapien cool, can you do this with jpeg xl or any supported image format I imagine?
2024-12-11 05:00:23
can you do what
A homosapien
2024-12-11 05:00:47
jxl -> slurp
Traneptora
A homosapien jxl -> slurp
2024-12-11 05:04:09
slurp doesn't interact with the contents of the file at all
2024-12-11 05:04:25
it just reads and writes them in a specific way
A homosapien
2024-12-11 05:04:59
interesting
Traneptora
2024-12-11 05:05:12
it's just a C file
2024-12-11 05:05:35
it reads from stdin entirely into memory, calls fclose, and only then opens the output for writing
AccessViolation_
2024-12-11 10:09:39
If I losslessly convert say a PNG to a JXL, is there a possibility of losing some color information thanks to quantization when it transforms RGB into XYB or is it always mathematically exact?
Salty
AccessViolation_ If I losslessly convert say a PNG to a JXL, is there a possibility of losing some color information thanks to quantization when it transforms RGB into XYB or is it always mathematically exact?
2024-12-11 10:11:55
just happened to be looking around ffmpeg jxl code and found this line. Seems to be about your question
2024-12-11 10:13:43
also jxlinfo uses this check to identify if it is defintely lossy or not
2024-12-11 10:14:42
so it seems that if you use original profile, it wont convert to XYB and can be mathematically exact
dogelition
AccessViolation_ If I losslessly convert say a PNG to a JXL, is there a possibility of losing some color information thanks to quantization when it transforms RGB into XYB or is it always mathematically exact?
2024-12-11 10:15:19
correct, lossless does not typically use XYB (only if you specifically request that via the API)
2024-12-11 10:15:40
if you just use `cjxl -d 0` or whatever it won't use XYB
AccessViolation_
2024-12-11 10:15:45
Ah, so I guess modular can just take the take the three channels from the original and copy them exactly instead of turning them into XYB
jonnyawsom3
2024-12-11 10:15:58
RCTs are separate and can store it as different colorspaces, but are fully reversible
AccessViolation_
dogelition correct, lossless does not typically use XYB (only if you specifically request that via the API)
2024-12-11 10:16:39
right, gotcha
RCTs are separate and can store it as different colorspaces, but are fully reversible
2024-12-11 10:19:05
I thought the transformation into XYB was what RCT referred to. Is it not?
jonnyawsom3
2024-12-11 10:21:06
I *think* even VarDCT can maintain colorspace with `uses_original_profile=true`, but I'm pulling this out of the depths of my brain
AccessViolation_ I thought the transformation into XYB was what RCT referred to. Is it not?
2024-12-11 10:22:06
RCT is a modular feature, Reversable Color Transform, purely helps in decorrelating the planes rather than perceptual quality like in VarDCT
Salty
2024-12-11 10:22:43
Does this seem reasonable or not?
2024-12-11 10:23:46
trying to use sane values for my encoding flow
jonnyawsom3
2024-12-11 10:25:44
Probably best if <@794205442175402004> fact checks us, in case I'm wrong
JKUser4592
2024-12-11 10:34:05
Do JXL files (lossy or lossless) support HDR colors while png ones do not?
AccessViolation_
Probably best if <@794205442175402004> fact checks us, in case I'm wrong
2024-12-11 10:36:14
nah it's okay dude I got the information I came for
2024-12-11 10:36:40
xD
_wb_
2024-12-11 10:37:30
RCT is reversible and not useful when used on XYB data — it's only used when doing lossless. When doing XYB, there is no point in also doing RCT...
JKUser4592 Do JXL files (lossy or lossless) support HDR colors while png ones do not?
2024-12-11 10:38:22
16-bit PNG with proper colorspace tagging (cICP or a modern HDR ICC profile) can certainly do HDR.
JKUser4592
_wb_ 16-bit PNG with proper colorspace tagging (cICP or a modern HDR ICC profile) can certainly do HDR.
2024-12-11 10:38:55
where did you get that at?
_wb_
2024-12-11 10:39:57
here are some examples: https://sneyers.info/hdrtest/
JKUser4592
2024-12-11 10:41:00
What about this? https://en.wikipedia.org/wiki/Comparison_of_graphics_file_formats#Technical_details
veluca
2024-12-11 11:05:19
"No, see discussion" unclear what that's supposed to mean... PNG can certainly do HDR in i.e. Chrome, I wrote that code 😛
A homosapien
veluca "No, see discussion" unclear what that's supposed to mean... PNG can certainly do HDR in i.e. Chrome, I wrote that code 😛
2024-12-11 11:28:59
https://en.wikipedia.org/wiki/Talk:Comparison_of_graphics_file_formats#PNG_is_not_a_High_Dynamic_Range_Image_Format Found the original change, some dude in 2010 thought images must store data in floating point to be considered HDR <:DogWhat:806133035786829875>
2024-12-11 11:31:49
I can't believe misinformation like this hasn't been corrected for so long 😅
veluca
2024-12-11 11:31:52
yeah that was true in 2010
2024-12-11 11:32:18
or true enough
2024-12-11 11:32:23
it is not true today though
JKUser4592
A homosapien https://en.wikipedia.org/wiki/Talk:Comparison_of_graphics_file_formats#PNG_is_not_a_High_Dynamic_Range_Image_Format Found the original change, some dude in 2010 thought images must store data in floating point to be considered HDR <:DogWhat:806133035786829875>
2024-12-12 12:12:59
<@179701849576833024> <@207980494892040194> That was the discussion? So can PNG support HDR or not?
veluca
_wb_ here are some examples: https://sneyers.info/hdrtest/
2024-12-12 12:14:24
it does, see this
jonnyawsom3
veluca "No, see discussion" unclear what that's supposed to mean... PNG can certainly do HDR in i.e. Chrome, I wrote that code 😛
2024-12-12 12:35:04
Or the message directly in-between your question and the message in your follow-up question ;P
JKUser4592 <@179701849576833024> <@207980494892040194> That was the discussion? So can PNG support HDR or not?
2024-12-12 12:35:42
Yes
Salty
2024-12-12 04:09:49
When there is no ICC profile should I be encoding with SRGB or LinearSRGB? <:peepothink:715229420838846466> Right now my logic is if ICC then use ICC otherwise use SRGB
Quackdoc
2024-12-12 04:19:16
depends on input, for instance, with exr input you should default to using linear
Salty
Quackdoc depends on input, for instance, with exr input you should default to using linear
2024-12-12 04:33:32
would always be 8-bit or 16-bit RGB and never floating point
Quackdoc
2024-12-12 04:34:27
sRGB is probably a safe assumption for most input formats, not all but most
2024-12-12 04:34:47
ofc you should be reading cicp too
Salty
2024-12-12 04:38:04
an ICC alternative <:monkaHmmm:738585281061453936>
2024-12-12 04:38:23
thanks for the info
2024-12-12 05:28:30
**Update for JPEG XL Plugin for Photoshop** (https://gitlab.com/SuperSaltyGamer/jpegxlformat) * Now supports lossy encoding. * Now supports EXIF and XMP. * Added save dialog with options for saving EXIF, XMP, compressing boxes and image quality. * Added info dialog when opening lossy images. * Added about dialog with build info. * Fixed crash with >2GB images.
2024-12-12 05:30:05
If nothing crazy surfaces I think this will be the last update for a long while. Highly recommend anyone who already started using the plugin to update
Demiurge
2024-12-12 08:01:06
Can JPEG1 have cicp tags?
2024-12-12 08:01:29
And hdr transfer curves
_wb_
2024-12-12 08:01:58
I don't think so, but you can embed an ICC profile with CICP...
2024-12-12 08:02:53
Most decoders will decode to 8-bit though, which will cause banding for a PQ image...
Demiurge
2024-12-12 08:13:20
I wonder how properly dithered 8 bit pq looks
2024-12-12 08:13:50
Like with libplacebo
2024-12-12 09:05:02
Also I wonder if libjxl dithers correctly taking nonlinear quantization into account
2024-12-12 09:51:25
Most software dithers incorrectly by not taking linear light scale into account
_wb_
2024-12-12 09:58:56
Not sure how much that difference matters when dithering with 3x8-bit colors, as opposed to dithering with a small palette of colors...
Demiurge
2024-12-12 11:07:59
Well, dithering isn't supposed to change the brightness... I don't know how bad it looks in that particular 8 bit scenario, but libplacebo does it right.
2024-12-12 11:08:14
Maybe someone ought to just integrate libplacebo into libjxl
2024-12-12 11:08:29
It would be a justifiable dependency
lonjil
2024-12-12 11:31:10
The difference should be small, since the sRGB curve looks close to linear when you're looking at 1/255 increments
2024-12-12 11:49:58
Possibly noticeably bad near 0. Going from sRGB value 1/255 to 2/255 is a 4.6x linear brightness increase, while going from 2/255 to 3/255 is a 2.4x increase. Though here the absolute values are very tiny.
Demiurge
2024-12-12 11:52:45
The absolute values but human vision is more sensitive to relative differences.
2024-12-12 11:53:21
Absolute differences mean nothing.
2024-12-12 11:55:11
Either way, there's a right way and a wrong way and most software does it the wrong way. And it's known that the wrong way is lower fidelity.
spider-mario
Demiurge The absolute values but human vision is more sensitive to relative differences.
2024-12-13 10:40:26
it’s a bit of both since we are less sensitive to equal relative differences when the absolute values are small (per the Barten ramp)
damian101
Demiurge Most software dithers incorrectly by not taking linear light scale into account
2024-12-13 11:08:41
Well, that sounds quite complex to account for that, afterall the quantization error to diffuse is in whatever colorspace you happen to be in.
2024-12-13 11:10:42
Would also necessarily add more noise, no?
Demiurge Either way, there's a right way and a wrong way and most software does it the wrong way. And it's known that the wrong way is lower fidelity.
2024-12-13 11:14:50
Does anything do it this right way?
VcSaJen
Demiurge Most software dithers incorrectly by not taking linear light scale into account
2024-12-13 04:01:52
Most software do ordered dither incorrectly when using a fixed palette. Though I'm not sure how would you do that. I guess you can consider color space as 3D space, and palette colors as points, using tetrangulation locate 4 points inside of which original color is located, and do ordered dither based on percentages of those colors? I'm not sure how it would handle points outside of convex hull of those points, or how badly it would look if tetrahedron is very stretched.
A homosapien
Does anything do it this right way?
2024-12-13 06:25:38
When converting 16-bit to 8-bit, gimp gives you the option to dither in linear light.
Demiurge
Does anything do it this right way?
2024-12-13 07:37:38
Yes. Like libplacebo for example, or libimagequant. But most people are too lazy and dither without taking into account actual brightness
2024-12-13 07:39:01
It's rare unless high fidelity image processing is the main focus of the software
2024-12-13 07:39:41
You could argue that's the main focus of libjxl too
2024-12-13 07:39:57
Idk if libjxl dithers in linear light or not
2024-12-13 07:41:40
But I would be surprised?
Would also necessarily add more noise, no?
2024-12-13 08:32:12
No, it wouldn't add any more noise, and it's not that complicated. You would just be calculating in linear light. Doing it the wrong way adds more noise/distortion because it changes the brightness of the image. Just like resizing an image in linear light vs nonlinear
2024-12-13 08:34:30
Basically, when reducing precision, and you have a pixel that falls somewhere in between 2 possible values, you do the comparison in linear light instead of the raw values.
2024-12-13 08:36:55
So if a pixel is 0.45 but the only values are 0.4 or 0.5, if you look at the raw value it's 50% of the way between... but if you convert that nonlinear value to linear light value first, then maybe it's actually closer to 90% between the two not 50%
2024-12-13 08:37:10
for a simplified hypothetical explanation
2024-12-13 08:37:37
Let's say 0.5 represents a brightness that's 3x as bright as 0.4
2024-12-13 08:38:24
Then 0.45 is not halfway between the two
2024-12-13 08:38:39
But that's how most lazy dithering works
2024-12-13 08:39:23
In software that doesn't really care about high quality like builtin os image viewers or ms paint style apps
2024-12-13 08:41:02
So in ordered dither 50% of the pixels will be 0.4 and 50% will be 0.5 and the result when looking at it, is a different amount of light and brightness compared to the actual 0.45 value the dither is supposed to be approximating
2024-12-13 08:42:30
Since the brightness values were not compared by how bright they actually are, but instead by some arbitrary, nonlinear number that doesn't have a linear correlation with how it actually looks
damian101
Demiurge No, it wouldn't add any more noise, and it's not that complicated. You would just be calculating in linear light. Doing it the wrong way adds more noise/distortion because it changes the brightness of the image. Just like resizing an image in linear light vs nonlinear
2024-12-13 08:42:52
No, that does not work. Simply doing that would not get rid of the quantization error you get in non-linear light.
Demiurge
2024-12-13 08:44:07
Well you can't get rid of quantization error but you CAN properly dither and get a best effort approximation without accidentally shooting yourself in the foot by comparing the wrong number that isn't the actual brightness
damian101
2024-12-13 08:44:46
Well, getting rid of simple quantization error is the whole point of dithering.
2024-12-13 08:45:18
Well, you technically still have quantization error. But it's spread out.
Demiurge
2024-12-13 08:45:40
You are spreading it out and statistically and perceptually shaping it
2024-12-13 08:46:28
But anyways it's the difference between comparing the correct number (brightness) and comparing some other, irrelevant number that's the wrong thing to compare.
damian101
2024-12-13 08:46:43
Yes, but simply applying the normal dither noise from linear light to non-linear light won't get rid of the banding entirely.
Demiurge
2024-12-13 08:47:36
You're comparing the brightness, not the binary encoding of the number
damian101
2024-12-13 08:47:42
I guess ideally you want to do error diffusion dither where the error that is to be diffused is measured in linear light, while it's always applied to non-linear light?
I guess ideally you want to do error diffusion dither where the error that is to be diffused is measured in linear light, while it's always applied to non-linear light?
2024-12-13 08:48:06
but error diffusion dither is slow of course
Demiurge
2024-12-13 08:48:23
What dither method you use makes no difference to what I'm saying
damian101
2024-12-13 08:48:52
well, it does, makes the whole implementation way more complex
Demiurge
2024-12-13 08:48:59
Either way you want to actually compare the brightness values, not some arbitrary and wrong number
2024-12-13 08:50:08
Not really... it's just comparing the correct number instead of an incorrect number
damian101
well, it does, makes the whole implementation way more complex
2024-12-13 08:50:30
like, simple random noise dithering is extremely simple, but doing so while targeting noise distribution in linear light, if that's the correct way to put it, becomes a rather compelx issue to solve
Demiurge Not really... it's just comparing the correct number instead of an incorrect number
2024-12-13 08:51:04
simple dithering doesn't compare anything, it's just noise
Demiurge
2024-12-13 08:51:35
You are comparing the original value to the available, possible quantized values
damian101
2024-12-13 08:51:53
for random dithering you just add noise
2024-12-13 08:52:02
before rounding down to the target bit depth
Demiurge
2024-12-13 08:52:05
There are lots of comparisons
damian101
2024-12-13 08:52:40
if you do error diffusion dither, but that's pretty slow
Demiurge
2024-12-13 08:53:45
Ordered dither has a dither matrix and the level/intensity of the matrix at that pixel depends on how far between the 2 possible values that pixel is
damian101
2024-12-13 08:54:22
right
2024-12-13 08:55:11
but ordered dither is pretty imperfect anyway
Demiurge
2024-12-13 08:55:31
Maybe I'm not the best at explaining it clearly but ordered dither is super fast and to do it properly you need to compare brightness values
2024-12-13 08:55:42
Not some other wrong value
2024-12-13 08:58:56
The dither matrix has a certain number of steps or levels depending on how close a value is to value A or B
2024-12-13 09:03:18
Jon is gifted at explanations
_wb_
2024-12-13 09:06:27
If the difference between the two nearest values is 1/255 and the transfer curve is sRGB then I doubt the difference between dithering correctly and dithering naively (nonlinearly) is important in practice. Doing it incorrectly would basically darken things by a small fraction of an off-by-one in 8-bit...
2024-12-13 09:22:29
When doing PQ in dithered 8-bit it will make a somewhat larger difference, but the difference between no dithering at all and lazy dithering will still be vastly larger than the difference between lazy and correct dithering.
damian101
_wb_ If the difference between the two nearest values is 1/255 and the transfer curve is sRGB then I doubt the difference between dithering correctly and dithering naively (nonlinearly) is important in practice. Doing it incorrectly would basically darken things by a small fraction of an off-by-one in 8-bit...
2024-12-13 09:24:15
yes, that was also my thought, either target precision is high enough that it barely matters, or ordered dithering could barely compensate for it due to lack of available color values, it's also quite restricted spatially afterall
_wb_
2024-12-13 09:24:33
When doing something like halftoning for printing, which is kind of like dithering to 1-bit, the difference between correct and incorrect dithering is going to be much more substantial
2024-12-13 09:26:34
Anyway, not sure how libjxl does it, it should in principle be possible to do it correctly since conversion from. XYB to the output space passes through linear RGB anyway...
Demiurge
2024-12-13 09:29:08
Here's a good article. https://threadlocalmutex.com/?p=93
2024-12-13 09:29:51
You'll notice dithering incorrectly causes darkened stripes similar to banding or quantization noise
2024-12-13 09:30:13
But slightly softened by the incorrectly applied dither
2024-12-13 09:31:03
It's better than no dither at all but it's an error to use an incorrect arbitrary value instead of the linear brightness value.
2024-12-13 09:32:43
But like Jon says, the amount of distortion caused is limited and always less than the difference between discrete quanta
2024-12-13 09:33:04
Still, an error is an error... if you ask me...
2024-12-13 09:35:07
The incorrect dither looks halfway between undithered and correct dither
2024-12-13 09:42:16
At the end of the article it says: > Anyway, the result using an approximate (and cheaper) gamma exponent of 2.0 is visually completely indistinguishable from applying the proper sRGB conversion for the purposes of dithering, so there's that. But then he doesn't elaborate on that. That's interesting...
2024-12-13 09:43:13
XYB uses a gamma exponent of 3 so I wonder...
spider-mario
2024-12-13 10:34:43
> Linearizing color values before computing and distributing the error, these artifacts disappear completely: not _completely_, as far as I can tell
2024-12-13 10:36:40
but yeah, it’s not necessarily _that_ trivial
2024-12-13 10:43:45
in audio, for nonsubtractive dither, triangular noise is generally preferred over rectangular (uniform) noise because it not only makes the mean of the quantisation error zero but also decorrelates its standard deviation from the signal, preventing noise modulation
2024-12-13 10:46:11
(https://www.researchgate.net/publication/236340550_Quantization_and_Dither_A_Theoretical_Survey)
2024-12-13 10:50:29
(subtractive dither for comparison – that’s when the original dither noise that was added to the signal before quantising is then subtracted from the quantised version)
DZgas Ж
spider-mario (https://www.researchgate.net/publication/236340550_Quantization_and_Dither_A_Theoretical_Survey)
2024-12-14 03:37:02
one image reminded me of one of my mistakes when I was making an algorithm for converting a spectrogram back to sound
spider-mario
2024-12-14 02:07:01
what I hear in my head when I see those waveforms: https://youtu.be/gVWiE2dHEdU?t=39
DZgas Ж
spider-mario what I hear in my head when I see those waveforms: https://youtu.be/gVWiE2dHEdU?t=39
2024-12-14 04:48:19
This sound reminded me of my "song" from 3 years ago https://youtu.be/q2h9LfMx_qs
DNFrozen
2024-12-15 12:27:45
I just tried to comvert a jpg image thats saved with CMYK instead of RGB but well seems like thats not supported. will it be supported eventually or will it be like this forever?
TheBigBadBoy - 𝙸𝚛
2024-12-15 12:43:38
there are several issues on GH for CMYK support see https://github.com/libjxl/libjxl/issues/3884
DNFrozen
2024-12-15 12:45:36
yup that command line error mesage is from cjxl
Tirr
2024-12-15 12:46:20
CMYK (YCCK) jpeg transcoding is not supported in current spec because Black channel cannot be VarDCT-encoded
DNFrozen
2024-12-15 12:47:59
so i gues if i want these images in jxl i have to convert them first to rgb and accept the conversion quality loss and thats not going to change anytime soon
Tirr
2024-12-15 12:49:07
or well... maybe original Black channel data could be stored as unknown data in jxl, not sure
DNFrozen
2024-12-15 12:54:34
image formats are much more complicated than i initally thought
CrushedAsian255
DNFrozen so i gues if i want these images in jxl i have to convert them first to rgb and accept the conversion quality loss and thats not going to change anytime soon
2024-12-15 01:10:23
You can store the image in CMYK natively in JXL, you just can't have *lossless* JPEG transcoding
jonnyawsom3
2024-12-15 01:12:52
So, `-j 0`?
CrushedAsian255
So, `-j 0`?
2024-12-15 01:19:00
yeah
_wb_
2024-12-15 04:04:30
I suppose technically you could losslessly transcode CMY as DCT data and then K decoded to pixels and stored losslessly.
Traneptora
_wb_ I suppose technically you could losslessly transcode CMY as DCT data and then K decoded to pixels and stored losslessly.
2024-12-16 03:50:50
would that be better than defining an annex N extension?
2024-12-16 03:50:57
to the frame header
Demiurge
_wb_ I suppose technically you could losslessly transcode CMY as DCT data and then K decoded to pixels and stored losslessly.
2024-12-16 05:03:02
Or maybe K as a layer?
2024-12-16 05:03:17
But it's better to just not have it encoded as cmyk lol
_wb_
Demiurge Or maybe K as a layer?
2024-12-16 08:16:42
The K channel has to be an extra channel so not VarDCT, though I suppose you could make a layer that pretends to be another CMY layer but it actually encodes K in its VarDCT (say using the Y of YCbCr applied to CMY, with Cb=Cr=0), and use kAdd blending or something, maybe that would kind of work
Traneptora to the frame header
2024-12-16 08:18:22
It's not just a header thing, generalizing VarDCT to deal with 4 channels would be a bit of a pain because everything is hardcoded for 3 channels: the quant tables, chroma from luma, the definition of gaborish/epf/noise/splines etc
Traneptora
_wb_ It's not just a header thing, generalizing VarDCT to deal with 4 channels would be a bit of a pain because everything is hardcoded for 3 channels: the quant tables, chroma from luma, the definition of gaborish/epf/noise/splines etc
2024-12-16 08:18:55
I meant encoding the K channel in a custom way and sticking it in an Annex N extension
2024-12-16 08:19:20
which would maybe be some sort of modular rectangle of coefficients or something?
_wb_
2024-12-16 08:20:31
I guess it wouldn't be impossible to allow using some kind of VarDCT for extra channels, but that would be an extension that is totally not backwards-compatible
2024-12-16 08:22:17
The idea of the extensions was to use them only for backwards compatible stuff, like storing info that can help decode faster (but without it, it still decodes), or maybe some subtle new ways to post-process (where it looks better if you do it like that, but it still decodes to something reasonable without knowing about the extension)
Demiurge
2024-12-16 09:50:44
I think it's a bad idea to try to losslessly transcode a CMYK image when CMYK is a terrible and inefficient way to store the image in the first place.
2024-12-16 09:51:01
No point in losslessly preserving stupidity
2024-12-16 09:51:41
CMYK is not meant for long term storage, it's meant for sending to a printer
_wb_
2024-12-16 01:54:37
but the CMYK can contain more information than an RGB version that looks the same on-screen. E.g. deep blacks and decisions about how to separate K cannot necessarily just be derived from an RGB version...
2024-12-16 01:56:17
though I kind of agree that it's basically one big confusion between something that should be handled at the level of the image reproduction technology and something that should be considered the actual image data
2024-12-16 01:57:05
(arguably RGB has the same problem since it's basically representing an image according to how screens work)
lonjil
2024-12-16 02:31:22
how many CMYK workflows actually involve thinking about how ink work and how many just have an artist drawing according to what looks good on the screen?
jonnyawsom3
_wb_ The K channel has to be an extra channel so not VarDCT, though I suppose you could make a layer that pretends to be another CMY layer but it actually encodes K in its VarDCT (say using the Y of YCbCr applied to CMY, with Cb=Cr=0), and use kAdd blending or something, maybe that would kind of work
2024-12-16 02:59:06
I was thinking of the layer method too. Then reconstruction could *probably* still be possible with something like the jbrd additions already in the work for UltraHDR, ect
VcSaJen
VcSaJen Most software do ordered dither incorrectly when using a fixed palette. Though I'm not sure how would you do that. I guess you can consider color space as 3D space, and palette colors as points, using tetrangulation locate 4 points inside of which original color is located, and do ordered dither based on percentages of those colors? I'm not sure how it would handle points outside of convex hull of those points, or how badly it would look if tetrahedron is very stretched.
2024-12-17 02:12:34
Found it: https://perso.liris.cnrs.fr/ostrom/publications/pdf/SIGGRAPH99_MultiColorDithering_600dpi.pdf Ordered dithering for fixed palette. It's a paper from 1999. I wonder why it's not impletented anywhere, if it's a solved problem. I expected at least ImageMagick to do it correctly.
jonnyawsom3
2024-12-17 02:25:38
I was reading a 1994 paper of perceptually guided quantization matrices for JPEG encoding that NASA made, yet it seems like jpegli is the only encoder to actually use it and not just a general 'optimized' table for all images based on a metric
Demiurge
_wb_ but the CMYK can contain more information than an RGB version that looks the same on-screen. E.g. deep blacks and decisions about how to separate K cannot necessarily just be derived from an RGB version...
2024-12-17 05:56:18
But CMYK data is usually automatically generated by a printer driver...
A homosapien
2024-12-17 07:19:35
Keyword "can"
nol
A homosapien https://discord.com/channels/794206087879852103/794206170445119489/1288880183603888304 And there is a newer draft here: https://discord.com/channels/794206087879852103/1021189485960114198/1256224842894540831
2024-12-17 09:27:47
Thanks!
_wb_
Demiurge But CMYK data is usually automatically generated by a printer driver...
2024-12-17 09:39:57
Obviously if CMYK is just algorithmically generated from RGB then it doesn't contain any extra information. But this is not what happens when e.g. illustrators are authoring images in a CMYK working space in tools like Adobe Illustrator or Photoshop.
CrushedAsian255
2024-12-17 11:51:57
how often does that happen though
2024-12-17 11:52:03
and then how often is that work saved as a jpeg
2024-12-17 11:52:14
and then how often are those JPEGs required to be losslessly converted
jonnyawsom3
2024-12-17 12:07:34
<https://cloudinary.com/tools/jpg-to-jxl>
2024-12-17 12:07:47
Hmmmmm
Tirr
2024-12-17 12:16:58
no loss in *visual* quality maybe
monad
2024-12-17 06:50:47
no loss in [some arbitrary measure of quality]
juliobbv
_wb_ Obviously if CMYK is just algorithmically generated from RGB then it doesn't contain any extra information. But this is not what happens when e.g. illustrators are authoring images in a CMYK working space in tools like Adobe Illustrator or Photoshop.
2024-12-18 07:08:15
a compelling case could be to enable rich black scenarios
2024-12-18 07:08:18
https://en.wikipedia.org/wiki/Rich_black
2024-12-18 07:09:11
where all four CMYK values are set to something greater than 0%
2024-12-18 07:10:34
and such values can be determined by the author, not algorithmically from RGB by the printer/converting software
Insanity
2024-12-18 03:48:54
Hey everyone! Has everyone tried to use JXL for HDR images? I'm trying to save space by converting my EXR photos to JXL images. The EXR converted to JXL via cjxl looks good on some software and on other ones the images are completely messed up! To my understanding a lot of software handles HDR in an inconsistent way... The only formats I found safe to use at this time of writing are PNG (exported from Krita) and EXR itself... Has anyone some experience or any tip about this topic?
2024-12-18 03:50:56
I honestly would prefer to use JXL since a EXR image weighs about 200MB, a PNG one about 100-120MB and a JXL weights about 20-30MB
nocpu
2024-12-18 04:00:39
Talking of XYB color space, it recently occured to me that whenever I have looked at various JXL files I've created using different cmd line options both lossless/lossly and later inspecting them with jxlinfo *.jxl or identify *.jxl (imagemagick). I've only ever seen sRGB mentioned in the output, never actually seen mention of XYB in the output anywhere on any of my files. Should I be seeing XYB on at least some?
Quackdoc
2024-12-18 04:10:38
JXL handles EXR really well since it wont truncate ranges greater then 0.0..1.0, but yes, a lot of software will handle HDR weirdly, especially if your image containes values greater then 1.0
Insanity Hey everyone! Has everyone tried to use JXL for HDR images? I'm trying to save space by converting my EXR photos to JXL images. The EXR converted to JXL via cjxl looks good on some software and on other ones the images are completely messed up! To my understanding a lot of software handles HDR in an inconsistent way... The only formats I found safe to use at this time of writing are PNG (exported from Krita) and EXR itself... Has anyone some experience or any tip about this topic?
2024-12-18 04:11:04
it's probably worth stating which images break
jonnyawsom3
nocpu Talking of XYB color space, it recently occured to me that whenever I have looked at various JXL files I've created using different cmd line options both lossless/lossly and later inspecting them with jxlinfo *.jxl or identify *.jxl (imagemagick). I've only ever seen sRGB mentioned in the output, never actually seen mention of XYB in the output anywhere on any of my files. Should I be seeing XYB on at least some?
2024-12-18 05:05:06
JXL uses XYB internally but the decoder has it's own color management to avoid inconsistent results, so it gets converted back to sRGB or whatever the input was when viewed
Insanity I honestly would prefer to use JXL since a EXR image weighs about 200MB, a PNG one about 100-120MB and a JXL weights about 20-30MB
2024-12-18 05:54:41
I'm assuming you're fine with it being lossy? Because that's what it'll be doing by default
Insanity
Quackdoc it's probably worth stating which images break
2024-12-18 07:54:03
Mainly JPEGXL, trying to have back and EXR or a PNG with HDR from a HDR JXL in most software is a dead end
Quackdoc
2024-12-18 07:54:52
oops, im dumb
2024-12-18 07:54:55
I meant image viewer
Insanity
I'm assuming you're fine with it being lossy? Because that's what it'll be doing by default
2024-12-18 07:54:57
Yeah! They're images taken with a camera
Quackdoc
2024-12-18 07:54:57
mb
Insanity
Quackdoc I meant image viewer
2024-12-18 07:56:25
IrfanView (completely off) surely
2024-12-18 07:58:14
JXL to EXR is surely broken both in Affinity Photo 2 and Krita triyng to reopen the EXR in Luminance HDR brokes almost all tone mapping modes In order to have a 'correct' the only way was to convert the jxl to png and then the converted png back to exr
jonnyawsom3
Insanity Yeah! They're images taken with a camera
2024-12-18 08:18:59
Huh, I'm surprised you have EXRs, they store the data as floats rather than integer numbers. Cameras are usually around 12bit integer
Insanity IrfanView (completely off) surely
2024-12-18 08:19:11
Do you have color management enabled?
2024-12-18 08:23:02
Insanity
Huh, I'm surprised you have EXRs, they store the data as floats rather than integer numbers. Cameras are usually around 12bit integer
2024-12-18 08:34:53
I build the file from Luminance HDR (using three camera JPEGs). Luminance HDR only exports EXR files and tone-mapped (SDR) files
2024-12-18 08:35:32
I also have the RAWs but the camera in-chip processing is better than any software I have installed on the pc
2024-12-18 08:36:10
Never tried Lightroom Classic however
jonnyawsom3
2024-12-18 08:52:43
Have you tried RawTherapee's 'Match JPEG' button? Tried to find the settings to match the in-camera processing based on the JPEG preview
Insanity
Have you tried RawTherapee's 'Match JPEG' button? Tried to find the settings to match the in-camera processing based on the JPEG preview
2024-12-18 09:12:22
I never knew about that, I opened RawTherapee but I cannot find it lmao
2024-12-18 09:12:24
Any clue?
jonnyawsom3
Insanity I never knew about that, I opened RawTherapee but I cannot find it lmao
2024-12-18 09:19:54
I think it's under the exposure tab, just moved from my computer annoyingly
spider-mario
Insanity JXL to EXR is surely broken both in Affinity Photo 2 and Krita triyng to reopen the EXR in Luminance HDR brokes almost all tone mapping modes In order to have a 'correct' the only way was to convert the jxl to png and then the converted png back to exr
2024-12-19 10:30:26
does using djxl to go from jxl to exr not work?
Insanity
spider-mario does using djxl to go from jxl to exr not work?
2024-12-19 04:12:53
Same problems as above, trying to tone mapping the reconverted EXR in luminance HDR results in a completely black image
2024-12-19 04:13:31
If, instead, the exr is generated from a BT 2100 with PQ PNG the error is not present
2024-12-19 04:13:53
even if the PNG comes from the JXL
spider-mario
2024-12-19 04:14:57
that’s odd, `djxl` should generate an EXR with the same range as the original, and the same `whiteLuminance` if present
jonnyawsom3
2024-12-19 05:58:46
Almost sounds like incorrect padding bits again
2024-12-19 05:59:47
But that was only an input error from people padding the wrong side of PNGs
Quackdoc
2024-12-19 06:05:06
can you provide a sample problematic image?
AccessViolation_
2024-12-20 10:50:03
Just out of curiosity, is there a mode in JPEG XL that will VarDCT encode the source image, then store the residuals of the source image minus the compressed image, and modular mode compress those, effectively giving you a VarDCT-based lossless mode? I had a thought that you could basically turn any existing lossy image or video compression format into a lossless format by just entropy coding the residuals after lossy compression for every frame
2024-12-20 10:52:25
I think you might be able to make an encoder that does this by using a VarDCT layer and one layer for the residuals and blending them in some way?
CrushedAsian255
2024-12-20 11:01:47
This wouldn't work as VarDCT is inexact
2024-12-20 11:02:06
so different decoders or even the same decoder on different hardware may give results that are slightly different
2024-12-20 11:02:20
due to floating point rounding issues and optimisations
2024-12-20 11:02:29
the spec explicitely allows a certain variation
2024-12-20 11:02:48
also for lossless encoding a specialised lossless encoded will usually work better, especially given how advanced JPEG XL's Modular mode is
CrushedAsian255 so different decoders or even the same decoder on different hardware may give results that are slightly different
2024-12-20 11:05:29
most lossy encoding systems also allow tolerances
jonnyawsom3
2024-12-20 11:06:04
This also already exists for video, but I can't recall the name... It's a side payload to the standard file that adds back the missing residuals to improve quality
CrushedAsian255
2024-12-20 11:06:40
it can work if you specially design a format where its lossy mode is exact, like WavPack
2024-12-20 11:07:00
or retroactively define an exact decoding procedure, like IIRC JPEG XL
AccessViolation_
CrushedAsian255 the spec explicitely allows a certain variation
2024-12-20 11:07:51
Ahh that's an important point. Reminds me of the decisions around WebAssembly, they had to weigh the importance of portability with identical behavior everywhere and floating point performance
CrushedAsian255
This also already exists for video, but I can't recall the name... It's a side payload to the standard file that adds back the missing residuals to improve quality
2024-12-20 11:08:17
in audio its not uncommon, DTS-HD MA, MPEG-4 SLS, WavPack Hybrid all come to mind
AccessViolation_
2024-12-20 11:10:24
With AVIF having pretty poor lossless performance on synthetic images I actually considered that they might be doing exactly this lol. DCT compressing a flat color would add artifacts which it would then have to store the residuals for to undo
jonnyawsom3
2024-12-20 11:13:16
Found it https://www.lcevc.org/how-lcevc-works/
CrushedAsian255 This wouldn't work as VarDCT is inexact
2024-12-20 11:15:21
If you converted the image to float 32, it *should* have enough exponent bits to be lossless. I know Jon mentioned similar with subtracting frames to encode residuals in animations https://discord.com/channels/794206087879852103/804324493420920833/1294404142713798657
AccessViolation_ With AVIF having pretty poor lossless performance on synthetic images I actually considered that they might be doing exactly this lol. DCT compressing a flat color would add artifacts which it would then have to store the residuals for to undo
2024-12-20 11:16:34
Yeah, that's pretty much what they do. It doesn't have a lossless path, it just does lossy and uses the low quality residual encoding
CrushedAsian255
2024-12-20 11:17:24
oh dear...
2024-12-20 11:18:21
what a beautifully designed format
AccessViolation_
Yeah, that's pretty much what they do. It doesn't have a lossless path, it just does lossy and uses the low quality residual encoding
2024-12-20 11:18:48
No way lmao
CrushedAsian255
AccessViolation_ No way lmao
2024-12-20 11:19:35
welcome to AVIF 🤷‍♂️
jonnyawsom3
2024-12-20 11:25:38
> Lossless is a variable which, if equal to 1, indicates that the block is coded using a special 4x4 transform designed for > encoding frames that are bit-identical with the original frames. I stand corrected, they do change the encoding... To only use 4x4 blocks instead....
AccessViolation_
2024-12-20 11:26:12
I just invented lossless AVIF and it sucks. I'm putting this on my resume
CrushedAsian255
> Lossless is a variable which, if equal to 1, indicates that the block is coded using a special 4x4 transform designed for > encoding frames that are bit-identical with the original frames. I stand corrected, they do change the encoding... To only use 4x4 blocks instead....
2024-12-20 11:26:37
so it becomes worse JPEG but lossless?
jonnyawsom3
AccessViolation_ I just invented lossless AVIF and it sucks. I'm putting this on my resume
2024-12-20 11:26:44
"Reinvented Lossless AVIF, but I realised it was stupid before trying to market it"
CrushedAsian255
2024-12-20 11:27:10
"Just use JPEG XL"
jonnyawsom3
CrushedAsian255 so it becomes worse JPEG but lossless?
2024-12-20 11:27:55
Looking at the 700 page spec, that was the only section actually specifying a difference. The other 40 mentions were just "If Lossless, don't deblock. If Lossless, don't use the loop filter"
CrushedAsian255
Looking at the 700 page spec, that was the only section actually specifying a difference. The other 40 mentions were just "If Lossless, don't deblock. If Lossless, don't use the loop filter"
2024-12-20 11:28:29
"If lossless, disable half of the coding features that make AV1 good"
jonnyawsom3
2024-12-20 11:28:59
Oh, and this > Note: When using both delta quantization and lossless segments, care should be taken that get_qindex returns 0 > for the lossless segments. One approach is to set FeatureData[ segmentId ][ SEG_LVL_ALT_Q ] to -255 for the > lossless segments.
2024-12-20 11:29:16
So you need to make sure the lossless is actually lossless
2024-12-20 11:34:23
On top of setting it to RGB and all the other nonsense outside the spec itself
AccessViolation_ Just out of curiosity, is there a mode in JPEG XL that will VarDCT encode the source image, then store the residuals of the source image minus the compressed image, and modular mode compress those, effectively giving you a VarDCT-based lossless mode? I had a thought that you could basically turn any existing lossy image or video compression format into a lossless format by just entropy coding the residuals after lossy compression for every frame
2024-12-20 11:35:30
But anyway, Kampidh's JXL frame tool might let you do that, or at least with minimal tweaking
2024-12-20 11:35:40
https://github.com/kampidh/JXL-Frame-Stitcher
2024-12-20 11:37:01
I wish it had a way to directly insert a JXL file though... I'm pretty sure it re-encodes JXL art, ect
AccessViolation_
2024-12-20 11:37:09
Ah neat. Aside from it not being technically lossless because of allowed imprecision, it would be interesting to see how this method conceptually would compare to lossless modular mode encoding of *photographic* images
jonnyawsom3
2024-12-20 11:37:48
Again, if you convert it to float first, you actually can make it lossless, just not good
If you converted the image to float 32, it *should* have enough exponent bits to be lossless. I know Jon mentioned similar with subtracting frames to encode residuals in animations https://discord.com/channels/794206087879852103/804324493420920833/1294404142713798657
2024-12-20 11:38:52
The link there has some more info
TheBigBadBoy - 𝙸𝚛
https://github.com/kampidh/JXL-Frame-Stitcher
2024-12-20 11:39:33
comics book with a single JXL file [⠀](https://cdn.discordapp.com/emojis/852007419474608208.webp?size=48&name=av1_woag)
CrushedAsian255
2024-12-20 11:39:59
even seekable! (if you assume one jxlc box and no cross-references)
jonnyawsom3
2024-12-20 11:40:14
VIPSview has pages support IIRC
2024-12-20 11:56:22
Correction, vipsdisp
2024-12-20 11:56:36
Surprised Irfanview doesn't, since it already has pages for PDF
Demiurge
2024-12-20 12:17:31
Do splines "belong" to a particular layer?
2024-12-20 12:18:39
Is there a special "spline layer" or do they have to be assigned to an existing frame/layer?
spider-mario
2024-12-20 01:30:42
existing layer, as far as I remember
Dejay
2024-12-20 01:40:58
Is there currently a tool that can join multiple jxl images into one larger image? Like jpegtran but ideally without that pesky factor of 8 thing? I know the answer is probably no haha
Demiurge
2024-12-20 02:02:39
The answer is yes
2024-12-20 02:03:22
I think jxl-frame-stitcher does this
2024-12-20 02:03:57
With JXL multiple frames can be stitched together losslessly into a larger composite image.
2024-12-20 02:04:16
No 8x8 limitation
Kampidh
2024-12-20 02:05:37
not larger in dimension tho, as it depends on the first frame
Demiurge
2024-12-20 02:11:18
But the canvas and frame dimensions are different
2024-12-20 02:12:28
Idk if jxl-frame-stitcher supports it but there is no technical reason why you cannot join smaller images into a larger one
2024-12-20 02:13:41
You could just as easily stitch a smaller image into a larger, blank, transparent image.
jonnyawsom3
2024-12-20 02:13:48
In other words no, not currently. You'd want a tool that increases the canvas size to the joined size, then layer the JXLs next to each other with an offset to do it the most simply. It could probably be done with a raw codestream though using 2048 DC blocks
Demiurge
2024-12-20 02:14:50
If jxl-frame-stitcher doesn't let you change the canvas size, then you can simply create a blank, transparent image of whatever canvas size you want.
2024-12-20 02:15:03
And stitch whatever images you want onto that
2024-12-20 02:15:17
As a workaround
2024-12-20 02:15:56
And maybe it will even let you delete the blank base canvas image as the last step after you finish positioning the other frames
2024-12-20 02:18:02
I have not tested jxl-frame-stitcher yet though
2024-12-20 02:20:07
One thing to keep in mind is when stitching multiple frames together the image will progressively load one frame at a time unless the frames are written in an interleaved way
2024-12-20 02:21:28
Like how libjxl interleaves the metadata after the preview image
jonnyawsom3
2024-12-20 02:27:48
Like I said before, IIRC it re-encodes the images, so if you're using lossy then it'll degrade further
Demiurge
2024-12-20 02:39:07
That sounds extremely unlikely. That would defeat the entire purpose of the frame stitcher.
2024-12-20 02:40:51
Unless it's primarily an animation tool...
2024-12-20 02:41:43
I thought a crucial purpose was to be able to losslessly stitch frames...
2024-12-20 02:42:38
There isn't an option to avoid reencoding?
jonnyawsom3
2024-12-20 02:42:38
<@274048677851430913> ?
Kampidh
2024-12-20 02:46:44
Nope, it always reencode sadly
2024-12-20 02:51:00
While as a workaround to make larger image, yes you can make a blank transparent image for the first layer that represents the final size. Maybe there should be a knob to override the canvas size though, thanks for the idea :p
Demiurge
2024-12-20 02:54:48
Stitching existing jxl frames together without reencoding would be a useful feature but maybe there isn't an easy way to reuse existing frames in the libjxl api...?
jonnyawsom3
2024-12-20 02:55:30
I don't think it's possible at all in the API. Best you could do is extract the codestream and insert it at the correct point
Kampidh
2024-12-20 02:57:06
And putting the xy pos in frame headers
Dejay
2024-12-20 03:48:22
Thanks for the ideas, yeah frame-stitcher re-encodes
2024-12-20 03:48:55
The other problem would of course be that for a webtoon you'd end up with a 940x200000 big image which most image viewers crap out on