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

DPI? Does JXL have scale factor information? #6

Open
yllan opened this issue Jan 20, 2021 · 5 comments
Open

DPI? Does JXL have scale factor information? #6

yllan opened this issue Jan 20, 2021 · 5 comments

Comments

@yllan
Copy link
Owner

yllan commented Jan 20, 2021

PNG

image

JPEG-XL Info
JxlBasicInfo(have_container: 0, xsize: 244, ysize: 76, bits_per_sample: 8, exponent_bits_per_sample: 0, intensity_target: 255.0, min_nits: 0.0, relative_to_max_display: 0, linear_below: 0.0, uses_original_profile: 1, have_preview: 0, have_animation: 0, orientation: __C.JxlOrientation(rawValue: 1), num_extra_channels: 1, alpha_bits: 8, alpha_exponent_bits: 0, alpha_premultiplied: 0, preview: __C.JxlPreviewHeader(xsize: 0, ysize: 0), animation: __C.JxlAnimationHeader(tps_numerator: 0, tps_denominator: 0, num_loops: 0, have_timecodes: 0))

@Evertt
Copy link

Evertt commented Jan 25, 2021

I was wondering this too, because when I tried to compare a jxl image using your app to its source jpg image in Preview, I clicked the menu item View -> Actual Size in both apps and I got different zoom levels in both apps, which seemed weird to me.

@yllan
Copy link
Owner Author

yllan commented Jan 26, 2021

cjxl and djxl currently didn't preserve the DPI information. I compress a 144 DPI png to jxl and then use djxl to decompress, it becomes a 72 DPI png.

Now I hardcoded the DPI to be 144 (@2x). Will change back to 72 DPI in the next release.

@Evertt
Copy link

Evertt commented Jan 26, 2021

cjxl and djxl currently didn't preserve the DPI information.

Did you already open a ticket for that on the official jxl repo? Or do you think they already have that on their todo list, but that they just haven't gotten to it yet?

@yllan
Copy link
Owner Author

yllan commented Jan 31, 2021

I opened an issue for this: https://gitlab.com/wg1/jpeg-xl/-/issues/123

@jonsneyers
Copy link

Currently cjxl silently strips exif/xmp from a PNG, and only encodes the pixel data and the ICC profile.

I didn't know Preview actually looks at DPI information to do "Actual size". I would expect "Actual size" to just show me pixels in native resolution (1:1). It would make sense to use DPI for that and have actual physical dimensions on the screen that match the intended physical dimensions, if it weren't for the fact that most DPI values are bogus default values that are ignored by most software, and have little to do with intended physical dimensions (which is a weird concept anyway, one that is relevant for print but not really for screen display imo).

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

No branches or pull requests

3 participants