summaryrefslogtreecommitdiff
path: root/Year_2/IandM
diff options
context:
space:
mode:
authorSanto Cariotti <santo@dcariotti.me>2021-02-21 12:16:41 +0100
committerGitHub <noreply@github.com>2021-02-21 12:16:41 +0100
commit020ac5aa148c2e70aa34fb798dbbe9b8778f32a0 (patch)
tree7ead1e3f398de23cd1700f655deb3e96bc956362 /Year_2/IandM
parent4a3ed80f51245c429086f2467097c03ec753d35b (diff)
Delete psnr_mse8365406430453607560.autosave
Diffstat (limited to 'Year_2/IandM')
-rw-r--r--Year_2/IandM/psnr_mse/psnr_mse8365406430453607560.autosave25
1 files changed, 0 insertions, 25 deletions
diff --git a/Year_2/IandM/psnr_mse/psnr_mse8365406430453607560.autosave b/Year_2/IandM/psnr_mse/psnr_mse8365406430453607560.autosave
deleted file mode 100644
index cac2b99..0000000
--- a/Year_2/IandM/psnr_mse/psnr_mse8365406430453607560.autosave
+++ /dev/null
@@ -1,25 +0,0 @@
-void setup() {
- size(512, 256);
- PImage img = loadImage("lena.png");
- img.resize(256, 256);
- img.filter(GRAY);
-
- image(img, 0, 0);
- image(quantization(img, 10), 256, 0);
-}
-
-PImage quantization(PImage I, int k) {
- PImage out = I.copy();
- out.loadPixels();
- int r;
-
- for (int i = 0; i < out.pixels.length; ++i) {
- r = (int) floor((red(out.pixels[i])*k)/256);
- r = int((float(r)/(k-1))*255);
-
- out.pixels[i] = color(r);
- }
-
- out.updatePixels();
- return out;
-}