Note: This project is still a work in progress. You can install the current executable by using:
cargo install glitchup
...however it's incomplete and you may encounter bugs.
If you have any questions, for example "What's databending?" or "Why did you make this?", check the Q&A
An example options file can be found at Options.toml
. I'll explain some important parts:
The inputfile
option needs to be set in order to specify which file to databend:
toml
inputfile = "somefile.jpeg"
You can also specify a file that's not in the current directory. A file being in subdirectories (dir/file.jpeg
) was tested, however a file being out of the current directory (../file.jpeg
) was not. This may work, however some further testing is currently required.
By default, the output file will have the same name as the input file (along with an appended string). If you'd like to save the file with a different name/directory, you can specify the outputfile
option.
toml
inputfile = "somefile.jpeg"
outputfile = "otherfile.jpeg"
Note: The output file's name will not be exactly the same as the name you specified. Currently, the format of the output files name is name<mutations>.extension
. This is to display what mutations the file underwent, while also avoiding overwriting existing files.
Currently there are 4 global options:
times
: This specifies how many times to run the program. iterations
: Specifies how many times the mutation should be performed before saving.chunksize
: The size of each chunk to mutate at a time.mutations
: The mutations to use.So with the following options:
toml
times = 2
iterations = [5]
chunksize = [1000]
mutations = [ ["Reverse"], ["Swap"] ]
The program is going to be run twice, with each run containing an output for
- A mutation of 1KB
chunks by applying Reverse
5 times, and
- A mutation of 1KB
chunks by applynig Swap
5 times
...resulting in 2 * 2 output files in total. (Times * No. of Mutations)
As you've seen above, iterations
and chunksize
need to be an array
. The reasoning behind this is that they can also have 2 values. In effect, they have two possible kinds of values:
iterations = [x]
: x
iterationsiterations = [x,y]
: Between x
and y
iterations.A number will be generated randomly between x
and y
for each time
. Even if you don't want a range, you just need to specify an array of size 1. This is because of the way the options are being loaded by the databender.
The mutations
option has been overhauled from BEND++! Now it uses an array of arrays
toml
mutations = [
["Reverse", "Swap"],
["Shuffle"],
...
]
Each element of mutations
is an array and represents a single output. This array can have multiple mutations chained together!
In the options shown above, it means that the first file will first be mutated by Reverse
, then by Swap
, then saved. Then a new copy of the original file will be made, mutated by Shuffle
, then saved. And so on...
Some mutations may have their own options that they require. For example, currently there is a Loop
mutation that requires an option loops
to be set. Each mutation has its own configuration as [<Mutation>Config]
, so to configure Loop
:
toml
[LoopConfig]
loops = [10]
This will set loops
to be 10
for the Loop
mutation. If you forget to specify this option, the program will specify which options it requires, and under which name.
TODO: Add example of error.
Note: In the case above, you only need to specify the loops
option if you include "Loops"
in the mutations
option! If you exclude "loops"
then the part above can be excluded as well.
What if, for example, you want Loop
to have different values for chunksize
? You can override them by simply specifying them under [LoopConfig]
:
toml
[LoopConfig]
loops = [10]
chunksize = [10,1000]
In this case, the iterations
used will be the global option set, however the chunksize
used will be taken from [LoopConfig]
.
This project is currently a prototype. As a result, any sort of feedback is heavily appreciated! If you'd like to contact me, you can use my email, or if you're on the Fediverse you can hit me up there!.
You can also open an issue, and I'll try to respond as fast as possible! Don't worry - any kind of feedback is accepted, be they feature requests, opinions, or criticism.