From 373a33bdbcaec4117eb05f863f8c4cf6435791ed Mon Sep 17 00:00:00 2001 From: WestonG40 <91216124+WestonG40@users.noreply.github.com> Date: Tue, 5 Sep 2023 23:46:46 -0400 Subject: [PATCH] Create URL Navigate the encryption of the URL. --- URL | 26 ++++++++++++++++++++++++++ 1 file changed, 26 insertions(+) create mode 100644 URL diff --git a/URL b/URL new file mode 100644 index 0000000..73599f8 --- /dev/null +++ b/URL @@ -0,0 +1,26 @@ +function save() { + const img = new SimpleImage(300, 300); + for (let i = 0; i < 300; i++) { + for (let j = 0; j < 300; j++) { + const targetPixel = target.getPixel(i, j); + const encryptionPixel = encryption.getPixel(i, j); + const pixel = img.getPixel(i, j); + pixel.setRed( + getValue(targetPixel.getRed()) / 16 + getValue(encryptionPixel.getRed()) + ); + pixel.setGreen( + getValue(targetPixel.getGreen()) / 16 + + getValue(encryptionPixel.getGreen()) + ); + pixel.setBlue( + getValue(targetPixel.getBlue()) / 16 + + getValue(encryptionPixel.getBlue()) + ); + } + } + img.drawTo(canvas); + let url = canvas + .toDataURL("image/png") + .replace("image/png", "image/octet-stream"); + window.location.href = url; +}