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

[Feature] Export PNG with multiple DAT chunks #385

Open
wants to merge 2 commits into
base: main
Choose a base branch
from

Conversation

VRPunk9036
Copy link

This allows the data in the PNG to be split up over multiple DAT chunks.

For my use case I used the option maximumDataChunkSize: 32768

let outputBuffer = PNG.sync.write(fullPunksPNG, {deflateStrategy: 0, filterType: 0, maximumDataChunkSize: 32768});

Motivation

  • I'm trying to recreate a PNG exactly how it was from pixel data. I noticed the exported PNG using pngjs had a single DAT chunk while the original file I try to recreate has multiple DAT chunks. With this fix I managed to make an exact replica of the original using the pixel data and the right compression settings.

@VRPunk9036
Copy link
Author

ping @lukeapage , not sure if I have to ping but I'm quite excited about having a PR 😅

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

Successfully merging this pull request may close these issues.

None yet

1 participant