Package 'pnglitchr'

Title: PNG Glitching in R
Description: Offers a thin wrapper around <https://github.com/chikoski/png-glitch>, a library to glitch PNG images.
Authors: Akiru Kato [aut, cre], N. Shimizu [cph] (Author of the original 'png-glitch' library)
Maintainer: Akiru Kato <[email protected]>
License: MIT + file LICENSE
Version: 0.0.3
Built: 2026-06-02 15:10:00 UTC
Source: https://github.com/paithiov909/pnglitchr

Help Index


Create a glitched PNG image

Description

Creates glitched PNG image data.

Usage

count_scanlines(x)

glitch_replace(x, times, seed = sample.int(1e+09, 1))

glitch_remove(x, from, lines)

glitch_transpose(x, src, dst, lines)

glitch_apply(
  x,
  from,
  lines,
  filter_type = c("none", "sub", "up", "average", "paeth")
)

Arguments

x

A character string specifying the path to a PNG file or a raw vector containing PNG image data.

times

An integer specifying the number of times to copy.

seed

An integer specifying the seed for the random number generator.

from, src, dst

Scan line index.

lines

Number of scan lines to be updated.

filter_type

Filter type. One of "none", "sub", "up", "average", "paeth".

Details

The following functions are available:

  • count_scanlines(): Returns the total number of scan lines in the PNG image.

  • glitch_replace(): Replaces the scan lines randomly.

  • glitch_remove(): Removes filter from the scan lines.

  • glitch_transpose(): Transposes some scan lines from src to dst.

  • glitch_apply(): Applies a specified filter to the scan lines.

Value

A raw vector containing glitched PNG image data.