Skip to content

Commit 69a0596

Browse files
committed
minor corrections
1 parent 627154e commit 69a0596

File tree

3 files changed

+8
-10
lines changed

3 files changed

+8
-10
lines changed

docs/index.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ Below is an overview of the project's architecture:
2727

2828
### Key Components
2929
- **`index.html`**: The main frontend interface where users select algorithms, perform operations, and upload images.
30-
- **`app.py`**: A Flask-based web server providing API endpoints for frontend interactions (see [API Reference](api_reference.md) for details).
30+
- **`app.py`**: A Flask-based web server providing API endpoints for frontend interactions (see [API Reference](pages/api_reference.md) for details).
3131
- **`algo_interface.py`**: An interface to access various visual secret sharing schemes. It maintains a dictionary that maps scheme names to their respective functions.
3232
- **`scripts/`**: Contains the core implementations of visual cryptography and random grid schemes.
3333
- `visual_cryptography/`: Contains different Visual Cryptography implementations.

scripts/random_grid/rg_grayscale_additive_SS.py

Lines changed: 6 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@ def get_requirements():
3333
# Returns a dictionary containing the description and reference links for the algorithm.
3434
def get_description():
3535
return {
36-
"text": "This (2,2) Visual Secret Sharing Scheme is a straightforward additive VSS scheme that handles grayscale images.",
36+
"text": "This (2,2) Visual Secret Sharing Scheme extends the general additive secret sharing scheme to handle grayscale images.",
3737
"links": [
3838
{"text": "Kafri & Keren",
3939
"url": "https://doi.org/10.1364/ol.12.000377"}
@@ -52,8 +52,7 @@ def create_random_grid(size):
5252
Returns:
5353
numpy.ndarray: A grid filled with random integer values between 0 and 255.
5454
"""
55-
grid = np.array([[secrets.randbelow(256) for _ in range(size[1])] for _ in range(size[0])], dtype=np.uint8)
56-
return grid
55+
return np.array([[secrets.randbelow(256) for _ in range(size[1])] for _ in range(size[0])], dtype=np.uint8)
5756

5857

5958
# Function to create a difference grid by subtracting the image from the random grid
@@ -66,10 +65,9 @@ def create_difference_grid(image, grid):
6665
grid (numpy.ndarray): The random grid (as a numpy array) to be transformed by subtraction.
6766
6867
Returns:
69-
numpy.ndarray: A grid where each value is the result of subtracting the corresponding image value from the grid.
68+
numpy.ndarray: A grid where each value is the result of subtracting the corresponding grid value from the image.
7069
"""
71-
transformed_grid = grid - image
72-
return transformed_grid
70+
return image - grid
7371

7472

7573
# Function to overlay two grids by performing subtraction
@@ -82,12 +80,12 @@ def decrypt(image1, image2):
8280
image2 (PIL.Image.Image): The second image (PIL Image object), to be converted to numpy array and processed.
8381
8482
Returns:
85-
PIL.Image.Image: The resulting image (PIL Image object) after subtracting the second grid from the first.
83+
PIL.Image.Image: The resulting image (PIL Image object) after adding the two grids.
8684
"""
8785
img1_array = np.array(image1.convert('L')) # Convert PIL Image to numpy array (grayscale)
8886
img2_array = np.array(image2.convert('L')) # Convert PIL Image to numpy array (grayscale)
8987

90-
overlaid_image = img1_array - img2_array
88+
overlaid_image = img1_array + img2_array
9189
return Image.fromarray(overlaid_image.astype(np.uint8)) # Convert numpy array back to PIL Image
9290

9391

scripts/visual_cryptography/vc_color_cmyk.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
# Returns a dictionary containing function mappings and metadata for the algorithm (used by the web interface).
66
def get_config():
77
return {
8-
"name": "VC - Color CMYK",
8+
"name": "VC - Color (CMYK) Halftone",
99
"description": get_description(),
1010
"requirements": get_requirements(),
1111
"encrypt": encrypt,

0 commit comments

Comments
 (0)