Comments (14)
Could you show me a PNG file with such chunks? Are they frequent? Is there useful data in these chunks?
from upng.js.
These chunks are similar to tEXt but take advantage of compression. They would only be present for specific use cases. In our case, we were embedding per-pixel data as text content (JSON) and, because of the size of these PNGs, we needed to compress the chunks for performance. I can't really provide an example, but it is part of the spec: https://www.w3.org/TR/PNG-Chunks.html
from upng.js.
I know what zTXt is and how it works. But I have never seen a PNG with such data. I don't like making my library 500 Bytes larger becaus of something, what is never used in a real world.
If you need to decode a PNG with zTXt chunk, could you share it with me? I am used to test an implementation, even if it is simple and seems to be correct.
from upng.js.
I concur to the usefulness of supporting compressed text chunks, not only zTXt chunks but also iTXt chunks with compressionFlag set to true.
from upng.js.
As I said, I have never seen a PNG with a zTXt and iTXt chung. So I think nobody uses it. Do you have such PNGs?
from upng.js.
Many libraries allow to set the compressionFlag to true when generating iTXt chunks, so such PNGs can easily be generated. If you do not want to add decompression you should at least consider adding a flag in the case of iTXt so the user can decide to deflate compressed content. Or maybe use an ArrayBuffer as the value instead of a string.
from upng.js.
Do you need to create PNGs with these chunks with UPNG.js , or to parse them?
I would be happy to implement it, but could you share such PNG with me? I do not use native apps other than a browser and a notepad (I develop in Javascript).
from upng.js.
Hi, my need is to be able to read compressed iTXt chunks using UPNG.js. Here is a data URL for a 1x1 PNG with an iTXt chunk with keyword 'UPNG.js' and a zlib compressed text associated with it:
data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAEAAAABCAYAAAAfFcSJAAAAUmlUWHRVUE5HLmpzAAEAAAB4nAvJyCxWAKLi/NxUheT83IKi1OLi1BSFktSKEoXE4uL85MzEEiC/PLMkQ6EkI1UhNMDPXS+rWCE7tbI8vyhFDwAcphfYZIu9eAAAAAtJREFUeNpjYAACAAAFAAHp+tzYAAAAAElFTkSuQmCC
from upng.js.
It is implemented now :)
from upng.js.
Awesome!
from upng.js.
thanks for sharing a PNG with us.
Although, I still doubt anybody will use this chunk. It is more convenient to store metadata in exif or xmp chunks.
from upng.js.
Supporting zTXt chunks should be as easy then, they are basically tEXt chunks except the text is deflated see https://www.w3.org/TR/PNG-Chunks.html
from upng.js.
XMP data is stored in iTXt chunks when taking a snapshot on MacOS, depending on data length maybe it may be compressed.
from upng.js.
I would like to make UPNG.js for files, which are made in practice. There exist e.g. a lossless JPG format, which was defined together with a lossy JPG, but is not supported by any decoder, as nobody ever used it. Are you sure zTXt are used in practice?
from upng.js.
Related Issues (20)
- tabs / loop parameter HOT 1
- Encode PNG with specific palette and samples information HOT 1
- Inflation algorithm used for decoding can go into infinite loop HOT 2
- LGTM.com issues in UPNG.js HOT 1
- APNG images at second index until <numimages> gets offset and gets wrong size HOT 9
- How do I encode my ImageData 1-to-1, keeping #12345600 color (RGBA) as it is, not dropping to #00000000? HOT 1
- Uncaught RangeError: byte length of Uint32Array should be a multiple of 4 HOT 5
- Reduce colors of raw ImageData without having to encode then decode a PNG HOT 3
- " Cannot read properties of undefined (reading 'deflate') " HOT 1
- Make png image transparent from reference image HOT 6
- How to tell if my pixel data is incorrect or my code is incorrect HOT 2
- Why use UZIP only when the data length is greater than 10e6? HOT 2
- Check for optional UZIP dependency throws error (for large images) HOT 3
- Make it tree-shakable HOT 10
- Image resizing HOT 1
- Output PNG file size not deterministic HOT 2
- Support for more compression HOT 2
- Uncaught TypeError: Cannot read properties of undefined (reading 'inflate') HOT 3
- 使用upng压缩png图片水波纹比较重,这个大家怎么解决的 HOT 1
- How to resolve this issue? Kindly help HOT 1
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 upng.js.