png_hide 0.0.2 copy "png_hide: ^0.0.2" to clipboard
png_hide: ^0.0.2 copied to clipboard

Hide text and other content into PNG files. The passed content gets encoded as Base64, then compressed using the LZW algorithm.

example/example.dart

import 'dart:io';
import 'package:png_hide/png_encoder.dart';

void encodeSample() {
  File input = File("assets/input.png");

  // output file ... does NOT have to exist yet
  File output = File("assets/output.png");

  PngEncoder pngEncoder = PngEncoder(input, output);

  String text = "When the war of the beasts brings about the world's end, The goddess descends from the sky Wings of light and dark spread afar She guides us to bliss, her gift everlasting.";

  //encode the String into the source image
  pngEncoder.encode(text);
}

void decodeSample() {
  File input = File("assets/input.png");

  // output file ... does NOT have to exist yet
  File output = File("assets/output.png");

  PngEncoder pngEncoder = PngEncoder(input, output);

  //get the text back from the output image
  String text = pngEncoder.decode();

  //outputs: "When the war of the beasts brings about the world's end, The goddess descends from the sky Wings of light and dark spread afar She guides us to bliss, her gift everlasting."
  print(text);
}

void main() {
  encodeSample();
  decodeSample();
}
0
likes
40
pub points
0%
popularity

Publisher

unverified uploader

Hide text and other content into PNG files. The passed content gets encoded as Base64, then compressed using the LZW algorithm.

Repository (GitHub)
View/report issues

License

BSD-2-Clause (LICENSE)

Dependencies

image

More

Packages that depend on png_hide