-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
b74d6f8
commit f9f3622
Showing
4 changed files
with
60 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,47 @@ | ||
#!/bin/bash | ||
CURRENT_DIR=$(pwd) | ||
|
||
# Directory containing PNG images | ||
IMAGE_PATH="$CURRENT_DIR/test_images/image.png" | ||
|
||
# Output directory for Resizer | ||
RESIZER_OUTPUT_DIR="$CURRENT_DIR/test_images/resizer-output" | ||
|
||
# Output directory for ImageMagick | ||
IMAGEMAGICK_OUTPUT_DIR="$CURRENT_DIR/test_images/imagemagick-output" | ||
|
||
# Ensure output directories exist | ||
mkdir -p "$RESIZER_OUTPUT_DIR" | ||
mkdir -p "$IMAGEMAGICK_OUTPUT_DIR" | ||
|
||
# Path to the Resizer executable | ||
RESIZER_PATH="./resizer" | ||
|
||
# Number of iterations | ||
ITERATIONS=100 | ||
|
||
# Start timing Resizer | ||
START_TIME=$(date +%s) | ||
for i in $(seq 1 $ITERATIONS); do | ||
$RESIZER_PATH "$IMAGE_PATH" 1024x1024 | ||
done | ||
END_TIME=$(date +%s) | ||
RESIZER_DURATION=$((END_TIME - START_TIME)) | ||
echo "Resizer took $RESIZER_DURATION seconds." | ||
|
||
# Move Resizer output to its directory | ||
mv "${IMAGE_PATH%.*}"*_1024x1024.png "$RESIZER_OUTPUT_DIR" | ||
|
||
# Start timing ImageMagick | ||
START_TIME=$(date +%s) | ||
for i in $(seq 1 $ITERATIONS); do | ||
convert "$IMAGE_PATH" -resize 1024x1024 "$IMAGEMAGICK_OUTPUT_DIR/$(basename "${IMAGE_PATH%.*}")_$i.png" | ||
done | ||
END_TIME=$(date +%s) | ||
IMAGEMAGICK_DURATION=$((END_TIME - START_TIME)) | ||
echo "ImageMagick took $IMAGEMAGICK_DURATION seconds." | ||
|
||
# Compare times | ||
echo "Comparison:" | ||
echo "Resizer: $RESIZER_DURATION seconds" | ||
echo "ImageMagick: $IMAGEMAGICK_DURATION seconds" |
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.