Skip to content

Corruption parameters

andreweathan edited this page May 14, 2023 · 9 revisions

These parameters are the backbone of pngfucker and give it its signature look and effect.

-shift (default 0)

Bitshift the image buffer to the right by this amount.
Negative amounts shift to the left!

Original -shift 1 -shift -8 -shift -3
original output output output
Shifting one bit
leaves the image
mangled-looking.
Because the image
was shifted 8 bits,
the color channels
have moved, turning
the green to blue.

#2: pngsmasher.cli -input cioss.png -seed 0 -shift 1 -splits 0 -regions 0 -crunch 100
#3: pngsmasher.cli -input cioss.png -seed 0 -shift -8 -splits 0 -regions 0 -crunch 100
#4: pngsmasher.cli -input cioss.png -seed 0 -shift -3 -splits 0 -regions 0 -crunch 100


-regions (default 4)

Creates corrupted "regions". This bitshifts the image buffer in a small area and swaps image bytes around.
This property has two sub-properties:

-rmin (def. -8)

Minimum region size in height pixels.

-rmax (def. -5)

Maximum region size in height pixels.

Positive values for rmin and rmax are how many Y lines the corruption should span for.
If you pass negative values, the property will be set to height / abs(rmin or rmax), where abs = the positive value of a number.
For example, a 1000x500 image with -rmin -5 and -rmax -2 means rmin = 500 / 5 = 100, and rmax = 500 / 2 = 250.

Original -regions 3
-rmin 5 -rmax 10
+ +bg
for visibility
-regions 32
-rmin 2 -rmax 12
+ +bg
for visibility
-regions 4
-rmin 10 -rmax 15
+ +bg
+ -crunch 60
eathan output output output

#2: pngsmasher.cli -input eathan.png -seed 1 -splits 0 -regions 3 -rmin 5 -rmax 10 -crunch 100 +bg
#3: pngsmasher.cli -input eathan.png -seed 1 -splits 0 -regions 32 -rmin 2 -rmax 12 -crunch 100 +bg
#4: pngsmasher.cli -input eathan.png -seed 1 -splits 0 -regions 4 -rmin 10 -rmax 15 -crunch 100 +bg -crunch 60


-splits (default 2)

A corruption effect where the image buffer is crunched and expanded, to give the effect of the image being sliced in half horizontally.
This simulates missing chunks and bits of a real corrupted image.
NOTE: This also performs a bitshift, but it doesn't reverse it afterwards on purpose, leaving the image glitched after a split.
This means that everything in your image will be glitched below the split line. This might be good or bad depending on what you want!
This property has two sub-properties:

-splitmin (default 0)

Minimum split start area in height percentage. All splits will not appear higher than this on the image.

-splitmax (default 100)

Maximum split start area in height percentage. All splits will not appear lower than this on the image.

Original -splits 2
+ -seed 2
+ -crunch 50
+ +bg
-splits 4
+ -seed 7
+ -crunch 60
+ +bg
-splits 2
-seed 2 -splitmin 50
+ -crunch 60
+ +bg
eathan output output output
-splitmin 50 forces
image splits to
always appear
at below 50% of the
image height

#2: pngsmasher.cli -input eathan.png -seed 2 -splits 2 -regions 0 -crunch 50 +bg
#3: pngsmasher.cli -input eathan.png -seed 7 -splits 4 -regions 0 -crunch 60 +bg
#4: pngsmasher.cli -input eathan.png -seed 2 -splits 2 -regions 0 -crunch 50 +bg -splitmin 50


-splitmin being used to only glitch the reflection side of an APNG:

Original Without -splitmin -splitmin 60
apngtest output_0_106 output_0_108

#2: pngsmasher.cli -input apngtest.png -seed 2 -splits 2 -regions 0 -crunch 50
#3: pngsmasher.cli -input apngtest.png -seed 2 -splits 2 -regions 0 -crunch 50 -splitmin 60

Animated -splits corruption example:

Original Splits
original output

pngsmasher.cli -input cioss.png -frames 40 -fps 10 -breaks 55 -crunch 60 -seed 100 -splits 1 -regions 0 -shift 0 -div 1 +bg -rmin -10 -rmax -8