How It Works Requirements Installation Usage Recipe Files Cook a Video Cookery Director Credits

Cookery

A command-line utility for concocting and cooking deepfrying recipes for image and video.

(Run it again!)
user ~ %
spongebob.jpg
Alt Text
resize 5
Alt Text
compress 99
Alt Text
modulate 558
Alt Text
contrast 204
Alt Text
edge 25

Cookery is a bash program that allows users to quickly and easily deep fry images and video from the comfort of the command line. The software utilizes 6 image transformation techniques found in deepfried memes: resize, compress, modulate, contrast, edge, and normalize. When these techniques are applied in different combinations and orders, many different results occur. Cookery uses recipe.txt files, a .TXT file format with a minimal syntax, to allow the user to save, edit and reuse sequences. Cookery also supports video files, allowing users to cook videos with one or more recipes.

Requires ImageMagick and FFMPEG for video support.

Clone the repository here.

Run the installation script to add the cook executable to your path:

sudo ./install.sh

To get cooking, all you need is an image! cook looks for the image file as the last argument. Alternately you can provide the input file with the -f flag.

cook spongebob.jpg or cook -f spongebob.jpg

The image or video file is the only required argument.

optional args:

By default, cooking steps will be saved to a file called recipe.txt. To use a different name, use -h [filename].

When we run

cook -h my_recipe.txt -o output_folder -f spongebob.jpg

we should see these files in output_folder:

my_recipe.txt
spongebob-step-1.jpg
spongebob-step-2.jpg
spongebob-step-3.jpg
spongebob-step-4.jpg
spongebob-step-5.jpg

Here's spongebob-step-5.jpg:

Alt Text

We can reuse my_recipe.txt on other images! To use a preexisting recipe file, pass the -r flag to cook:

cook -r output_folder/my_recipe.txt -o output_folder -f mr-krabs.jpg

Here's the resulting mr-krabs-step-5.jpg, cooked with my_recipe.txt:

Alt Text

cook also works with video! Here's how to cook a video at 60 frames per second (the default is 30fps), saving all generated files in the video-output folder:

cook -r my_recipe.txt -fr 60 -o video-output vid.mp4

This script generates individual frames from the video at the specified framerate, saves cooked versions of each frame following the recipe file into a cooked subfolder, and recombines those frames back into a video called out.mp4 in cooked.

Instead of using a single recipe file to cook all frames of a video, you can provide a combination of recipe files and specify which frames they apply to using the Cookery Director flag, -d. This points to a director file.

The director file contains one or more lines containing this format:

[1st frame],[recipe file],[optional recipe file]

For example:

1,recipe1.txt
200,recipe2.txt,recipe3.txt
800,recipe3.txt

This file will apply recipe1.txt to frames 1-199. Then from frame 200-799, recipe2.txt will be applied with decreasing strength, while recipe3.txt will be applied with increasing strength. This achieves a keyframe-like effect (!!!!!!!) Then recipe3.txt will be applied from frame 800 to the final frame. Each recipe file is given as its relative path from the director file.

cook -d ./director -fr 60 -o video-output vid.mp4

Hot tip: to see how many frames are in a video, use the -fc flag:

cook -fc vid.mp4
total frames: 150