Skip to content

Commit

Permalink
Merge pull request #27 from UBC-MDS/proofread
Browse files Browse the repository at this point in the history
Proofread
  • Loading branch information
JennyonOort authored Jan 11, 2025
2 parents b8d5447 + 1180eda commit e035d15
Show file tree
Hide file tree
Showing 4 changed files with 53 additions and 27 deletions.
17 changes: 15 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# sharpedge
# SharpEdge

Collection of image processing tools and techniques, including padding, flipping, colorscale conversion, seam carving, and image shrinking. Designed for efficient manipulation and transformation of images.

Expand Down Expand Up @@ -51,6 +51,12 @@ To harness the image processing magic of SharpEdge, follow these steps:
```

2. Load your image as a NumPy array.

```python
# Load an image from a specific path and convert it to a numpy array
img = load_image(img_path)
```

3. Process your images using the available functions:
- Flip, rotate, and shift an image based on the specified requested action:

Expand Down Expand Up @@ -94,9 +100,16 @@ To harness the image processing magic of SharpEdge, follow these steps:
resized_img = seam_carve(img, target_height=300, target_width=400)
```

4. Display your modified image.

```python
# Display the numpy array as an image
display_image(repositioned_img)
```

## Contributors

Archer Liu, Inder Khera, Hankun Xiao, Jenny Zhang (ordered alphabetically)
Archer Liu, Hankun Xiao, Inder Khera, Jenny Zhang (ordered alphabetically)

## Contributing

Expand Down
29 changes: 29 additions & 0 deletions tests/display_image.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
# This function is created solely for the purpose of unit testing.
# It is not intended to be part of the actual software package.
# Please refrain from using this function in production or in any user-facing features.
#
# It is placed in the tests folder to separate from core software functionality.
# It is included to help validate specific components of the code during testing.
# This function may be removed or modified as needed for the testing process.

def display_image(img):
"""
Display the numpy array as an image.
Parameters
----------
img : numpy.ndarray
The image data as a numpy array
with shape (height, width, channels).
Raises
------
ValueError
If the file is not a valid numpy array.
Examples
--------
>>> img = load_image('image.jpg')
>>> display_image(img)
"""
pass
33 changes: 9 additions & 24 deletions src/sharpedge/sharpedge.py → tests/load_image.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,11 @@
# This function is created solely for the purpose of unit testing.
# It is not intended to be part of the actual software package.
# Please refrain from using this function in production or in any user-facing features.
#
# It is placed in the tests folder to separate from core software functionality.
# It is included to help validate specific components of the code during testing.
# This function may be removed or modified as needed for the testing process.

def load_image(path):
"""
Load an image from a specific path
Expand Down Expand Up @@ -27,27 +35,4 @@ def load_image(path):
>>> print(img.shape)
(1280, 800, 3)
"""
pass


def display_image(img):
"""
Display the numpy array as an image.
Parameters
----------
img : numpy.ndarray
The image data as a numpy array
with shape (height, width, channels).
Raises
------
ValueError
If the file is not a valid numpy array.
Examples
--------
>>> img = load_image('image.jpg')
>>> display_image(img)
"""
pass
pass
1 change: 0 additions & 1 deletion tests/test_sharpedge.py

This file was deleted.

0 comments on commit e035d15

Please sign in to comment.