Git Product home page Git Product logo

png-codec's People

Contributors

chaseknowlden avatar dependabot[bot] avatar tyriar avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar

png-codec's Issues

Allow warnings to be ignored, support strict decoding mode

Currently decoding is done in a strict only mode, where assertions that should be warnings still throw. Ideally there would be warnings and errors where warnings are gathered and returned to the embedder and errors throw. Along with this default mode, there should be a strict mode that fails when any warning is encountered.

Might also want to add an "info" severity for when chunk types are unrecognized but flagged as optional for example.

Support encoding 16-bit images to BT.2020, BT.2100

Would be great if files like this could be created from floating-point linear data:
(this file uses Rec. ITU-R BT.2100 PQ and will display with HDR colors on supported displays, like MacBook displays or properly configured windows systems, on Chrome)

lonely_road_afternoon_puresky_1k2

Make sure packaged module will work

Currently I use a git submodule to consume the lib, not sure I got the esm module right and the typings don't declare a module currently.

Fix alpha tests

Currently a bunch of unit tests are skipped because either alpha and/or hue values don't end up matching the bmp converted in pngsuite. This is probably some optimization when saving the bmp but it would be ideal to have exact information.

Consider measuring code coverage

Generally I don't like using code coverage for large projects, but this is probably a good case since testing is extensive and it would help identify any edge cases not yet which could be added as extensions to pngsuite. Could then also add it to the claims on the readme

Consider adding support for non-standard png extensions

From http://fileformats.archiveteam.org/wiki/PNG

Chunk type References and remarks
oFFspCALsCALgIFggIFxgIFt**, fRAc Refer to Extensions to the PNG 1.2 Specification, v1.2.0.
sTER Refer to Extensions to the PNG 1.2 Specification, v1.3.0.
dSIG Refer to Extensions to the PNG 1.2 Specification, v1.4.0, and the PNG dSIG website.
acTL, fcTL, fdAT Used in APNG files.
vpAg, caNv, orNT Used by ImageMagick.
CgBI Refer to CgBI.
eXIfexIf* Exif metadata. Refer to PNG Proposed eXIf chunk [approved 2017-07].
iDOT Used by Apple products. Some info at [1].

* Not doing to implement exIf as it's for test impls
** gIFt is deprecated

Allow decoder to be extended with private chunk types

In order to support custom/private png formats, or just chunks that aren't supported yet, the library should have some way of injecting "chunk decoders" that would provide this. For example with this feature before apng is done (#10) it should be possible to extend the lib to support apng with this feature.

Some basic questions about usage

@Tyriar Wow this lib looks really nice, grats for getting it done that sophisticated, must have been alot of work. I def. will look into it.

First I have a few questions about proper usage:

  • In api.d.ts you state for decodePng:
  • Note that it's best to drop references to both metadata and rawChunks as soon as they are no
  • longer needed as they may take up a significant amount of memory depending on the image.

Does that mean, that the decoder carries the raw data along, thus should be removed manually from the returned IDecodedPng to free some memory?

  • For terminal output I'm only interested in pixel data (rgba) + dimension notion. I see that is contained IImage32 and IImage64. Is the pixel data there always fully RGBA colored, or is there a catch with some image modes (e.g. paletted contains idx, thus needs another indirection to resolve to real colors)?
  • The pixel being RGBA8888 - is that RGBA32 or ABGR32 aligned on LE? Not sure yet, if I'll need 32bit access pattern at all, but I found that being way faster than single channel handling in the sixel lib.
  • Whats the deal with 32 vs. 64, what exactly determines the bit depth of channels and can I somehow tell the decoder to always output IImage32 or would I have to do the color reduction afterwards? Dont want to go the 16bit channel route for now, as it just puts the memory under even more stress.
  • Later on I want to use the encoder for serialization. Are there any hints/pitfalls with PNG encoding in general (see me as a PNG noob here)?
  • About those promises - at which level is encoding/decoding async? Is it timer based/cooperative, or some real worker concurrency?
  • Is it possible to feed the decoder from arbitrary chunks (stream decoding)?

Sorry for so many questions, plz dont feel bugged by that, I dont need detailled answers but just some yes/no or a code pointer here and there.

Btw #15 would be a killer feature - imho APNG is a very nice, but sadly totally underrated format.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.