It's glitching time!
JpegGlitcher
only exports the glitch
function.
glitch
takes an image, compresses it using the JPEG encoding, safely modifies
some bytes of the compressed version and return the decoded version.
Here is a basic example, using the default parameters.
using JpegGlitcher
using RandomFileIO, TestImages
img = testimage("mountainstream")
glitch(img)
We can also make an animation, playing with the different parameters!
cat([glitch(img; rng = Random.Xoshiro(42), n = i, quality = 20) for i in 1:50]...; dims=3)
You can also directly glitch a file by loading FileIO.jl
and ImageIO.jl
.
using JpegGlitcher, FileIO, ImageIO
glitch("my_beautiful_img.png", "my_glitched_img.png")
The glitching will work on any image format supported by ImageIO
.