-
-
Notifications
You must be signed in to change notification settings - Fork 1.3k
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
Enhancement: write PNG tEXt chunks #3549
Comments
here is an image that includes the 'tEXT' data section the decoded chunk is as follows: keyword: paramaters |
"Artificial Intelligence" hyperbole aside, there are existing metadata standards such as EXIF that might be more suitable for such image generators to use, however The I'd suggest something like the following data structure to expose this, both when reading via metadata() or writing via a new property of png(). // PROPOSED API, NOT YET AVAILABLE
comments: [
{ keyword: 'parameters', text: 'highly detailed...' },
{ keyword: 'Copyright', text: 'legal minefield' },
...
] A PR to expose this in sharp would be welcome, if you're able. |
This comment was marked as off-topic.
This comment was marked as off-topic.
This comment was marked as off-topic.
This comment was marked as off-topic.
v0.33.5 added support for reading PNG tEXt chunks from an input via #4157. This issue remains open to track the future possible enhancement to control setting/updating PNG tEXt chunks in the output. |
Hi @lovell Just out of curiosity, if I want to implement the write I might need this later for embedding a set of JSON string for putting on server-rendered UIs on to some e-paper HMI devices. If I need it I will try implementing it and send you guys a pull request. |
@huming2207 Thank you for the offer, a PR would be welcome if you're able. You could use either As an aside, to anyone implementing this, we'll need to think carefully about how setting one or more comments might interact with existing comments, especially given the use of an (internal-only) index as part of the name. |
Hi @lovell thanks for the info. I made another separate Rust based binding library in the past, that does dithering for 4-bit grayscale to "emulate" 8-bit grayscale which makes the output probably looks nicer: https://github.com/huming2207/epaperify Anyway I'm not sure yet. I may also work on that one instead. I will investigate further and see what should I do next. |
With the MASSIVE generative AI movement, automatic1111 has become a staple tool for image generation. This tool creates images that include lots of data regarding the configuration of any image in the 'tEXT' chunk of an image's metadata. It does not appear that sharp has a way to read or write to this section of the images data.
The text was updated successfully, but these errors were encountered: