png_chunks_encode 1.0.0 copy "png_chunks_encode: ^1.0.0" to clipboard
png_chunks_encode: ^1.0.0 copied to clipboard

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.

png_chunks_encode #

pub package

Dart port of png_chunk_text.

Features #

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 👻

Getting started #

In the pubspec.yaml of your flutter project, add the following dependency:

dependencies:
...
png_chunks_encode: ^1.0.0

Import it:

import 'package:png_chunks_encode/png_chunks_encode.dart' as pngEncode;

Usage #

import 'package:png_chunks_encode/png_chunks_encode.dart' as pngEncode;

final buffer = pngEncode.encodeChunks(chunks);

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

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

And returns a Uint8List containing the raw PNG buffer.

Example: #

test/png_chunks_encode_test.dart

0
likes
110
pub points
36%
popularity

Publisher

unverified uploader

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.

Repository (GitHub)
View/report issues

Documentation

API reference

License

MIT (LICENSE)

Dependencies

flutter

More

Packages that depend on png_chunks_encode