Add ability to write pixel density into pngs#79
Merged
timholy merged 2 commits intoJuliaIO:masterfrom Feb 20, 2025
Merged
Conversation
Contributor
Author
|
The failing run on mac aarch64 seems to be the same in all recent CI runs, so not related to this code change. Otherwise this is good to go from my side. |
stemann
reviewed
Feb 10, 2025
Comment on lines
+343
to
+345
| - `dpi`: stores the pixel density given in dots per inch into the `pHYs` chunk as pixels per meter. | ||
| The density is given as `dpi` for ease of use as pixels per meter is an uncommon format. If set to `nothing`, | ||
| no pixel density is written. If set to a 2-element tuple, a different density is written for x and y, respectively. |
Member
There was a problem hiding this comment.
Pixels per meter seems to be native to PNG (cf. https://www.w3.org/TR/PNG-Chunks.html), and it is using an SI unit, so even though DPI may be more common, why not at least support both a pixels_per_meter and a dots_per_inch keyword?
Contributor
Author
There was a problem hiding this comment.
would also be possible, I just don't think anybody will really use that :)
timholy
reviewed
Feb 15, 2025
Member
timholy
left a comment
There was a problem hiding this comment.
Other than possible test issues, LGTM
Co-authored-by: Tim Holy <tim.holy@gmail.com>
Member
|
Thanks! |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
I would like to make Makie write
dpiinformation into the pngs it produces. This PR adds the necessary ability to PNGFiles.