-
Notifications
You must be signed in to change notification settings - Fork 2
/
recipe.tsx
64 lines (62 loc) · 1.51 KB
/
recipe.tsx
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
import { Ingredient } from "@/util/ingredients"
/**
* A recipe is a collection of ingredients that can be applied to an image.
*/
export type Recipe = {
name: string
description: string
destroy_factor: number
quality: number
ingredients: Ingredient[]
preview: string
}
/**
* A list of recipes that can be applied to an image.
*/
export const recipes: Recipe[] = [
{
name: "No Recipe",
description: "No modifications",
destroy_factor: 0,
quality: 100,
ingredients: [],
preview: "/chick.jpg",
},
{
name: "Lite",
description: "Adds a little bit of compression artifacts",
destroy_factor: 10,
quality: 10,
ingredients: [], // no ingredients needed since the quality is 10
preview: "/examples/lite.jpeg",
},
{
name: "Noise",
description: "Adds a little bit of noise",
destroy_factor: 15,
quality: 95,
ingredients: [{ id: "exponential_noise", with: { scale: 30 } }],
preview: "/examples/noise.jpeg",
},
{
name: "Artifact Hell",
description: "Adds a lot of compression artifacts",
destroy_factor: 50,
quality: 0,
ingredients: [],
preview: "/examples/artifact-hell.jpeg",
},
{
name: "Pro+",
description: "Completely destroy your image",
destroy_factor: 90,
quality: 0,
ingredients: [
{ id: "sharpness", with: { factor: 100 } },
{ id: "contrast", with: { factor: 100 } },
{ id: "posterize", with: { bits: 2 } },
{ id: "invert" },
],
preview: "/examples/pro-plus.jpeg",
},
]