1.0.0 • Published 10 years ago

png-chunks-encode v1.0.0

Weekly downloads
2,764
License
MIT
Repository
github
Last release
10 years ago

png-chunks-encode

stable

Return a fresh PNG buffer given a set of PNG chunks. Useful in combination with png-chunks-encode to easily modify or add to the data of a PNG file.

By adding your own tEXt or zEXt chunks you have a useful alternative to LSB steganography for making "magical" images with "secret" data available for your applications: the data is hardly hidden this way, but you can store as much as you like. If you really wanted to, you could probably get away with sneaking a 300MB 3D model in there without too much trouble 👻

Usage

NPM

buffer = encode(chunks)

Takes an array of chunks, each with a name and data:

[
  { name: 'IHDR', data: Uint8Array([...]) },
  { name: 'IDAT', data: Uint8Array([...]) },
  { name: 'IDAT', data: Uint8Array([...]) },
  { name: 'IDAT', data: Uint8Array([...]) },
  { name: 'IDAT', data: Uint8Array([...]) },
  { name: 'IEND', data: Uint8Array([]) }
]

And returns a Uint8Array containing the raw PNG buffer.

See Also

License

MIT, see LICENSE.md for details.

@infinitebrahmanuniverse/nolb-pnguangdaiexcalidraw-hp-test@everything-registry/sub-chunk-2450tavernaiteaching_component_dimages-metahello_excalhello_excalilinearpad-skmagical-canvaskoishi-plugin-chatluna-character-card@weiwenda/excalidraw@thenewvu/excalidraw@zsviczian/excalidraw@zhtecinc/excalidraw@atyrode/excalidraw@100mslive/hms-excalidraw@guangdai/excalidraw@edwardw483/excali@edwardw483/excalidraw@edwardw483/excaliwhitelist@alkemio/excalidrawstencila-convert@betternotion/excalidraw@chaitin_rivers/excalidrawtry_excalidraw_whiteboard@dwelle/excalidraw@kristiankostecky/excalidrawmydraw2324sahil_ccsahil_pkgsahil_ugpng-text-metapng-packpng-strip-chunkssillytaverncollabted-excalidrawd_teaching_componentdemotest_excalidemowork_excalidrawfriday_cc@tdtdev/excalidraweducatewhiteboard_pkgexcalidraw_inside_checkexcalidraw_karatexcalidraw_master_sahilexcalidraw_master_test1excalidraw_new_test_00excalidraw_npm100excalidraw_sigmathexcalidraw_test2excalidraw_vrandaexcalidraw_vranda_mamexcalidraw_white_test23excalidrawbasicexcalidraw-collaborationexcal_inside_checkexcali-customexcali-toolexcalidraw-customizationexcalidraw-gdexcalidraw-jbexcalidraw-local-collab-forkexcalidraw-ua5excalidraw-with-storageexcalidraw-zhexcalidraw0990excalidraw_app23excalidraw-custom@jim-squirrel/excalidraw@maposia/excalidraw@innei/excalidraw@elsci-io/excalidraw@fileverse-dev/excalidraw@notud/excalidraw@npclown/excalidraw@niren-ai/common@excalidraw/utils@excalidraw/excalidraw@evgsyro/excalidraw@hungnguyen157/excalidraw@oatkachenko/excalidraw@opentechiz/excalidraw
1.0.0

10 years ago