lsb_encode: Encode text into a lossless image

Description Usage Arguments Author(s) Examples

View source: R/lsb.R

Description

Takes an image matrix from something like png::readPNG. Note that this cannot be saved out as jpeg as the lossy compression will drop the message

Usage

1
2
3
lsb_encode(content, img, force_object = FALSE)

lsb_decode(img)

Arguments

content

Content to save into the image; can be a text string or an arbitrary R object.

img

An image matrix to save the message into

force_object

Logical: Force saving a scalar text string as an R object (will be slightly more space efficient).

Author(s)

Rich FitzJohn

Examples

1
2
3
4
img <- png::readPNG(system.file("img/Rlogo.png", package = "png"))
txt <- "hello from stegasaur"
img2 <- lsb_encode(txt, img)
lsb_decode(img2)

richfitz/stegasaur documentation built on Feb. 12, 2021, 1:41 a.m.