Skip to content

JuliaWTF/JpegGlitcher.jl

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

14 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

JpegGlitcher

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)

Glitched version of the Mountain View image

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)

Low quality animated glitching

Glitch file

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.