Skip to content

Commit 10c28d1

Browse files
committed
Update image scripts
Signed-off-by: Bensuperpc <[email protected]>
1 parent 088bd7a commit 10c28d1

File tree

2 files changed

+40
-1
lines changed

2 files changed

+40
-1
lines changed

image/image_bit_depth.sh

Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,31 @@
1+
#!/usr/bin/env bash
2+
#//////////////////////////////////////////////////////////////
3+
#// ____ //
4+
#// | __ ) ___ _ __ ___ _ _ _ __ ___ _ __ _ __ ___ //
5+
#// | _ \ / _ \ '_ \/ __| | | | '_ \ / _ \ '__| '_ \ / __| //
6+
#// | |_) | __/ | | \__ \ |_| | |_) | __/ | | |_) | (__ //
7+
#// |____/ \___|_| |_|___/\__,_| .__/ \___|_| | .__/ \___| //
8+
#// |_| |_| //
9+
#//////////////////////////////////////////////////////////////
10+
#// //
11+
#// Script, 2021 //
12+
#// Created: 01, October, 2021 //
13+
#// Modified: 27, October, 2021 //
14+
#// file: - //
15+
#// - //
16+
#// Source: https://askubuntu.com/a/271797/971804 //
17+
#// OS: ALL //
18+
#// CPU: ALL //
19+
#// //
20+
#//////////////////////////////////////////////////////////////
21+
22+
if (( $# >= 3 )); then
23+
for var in "$@"
24+
do
25+
convert -depth "$3" +dither "$2" "$1"
26+
done
27+
else
28+
echo "Usage: ${0##*/} <input image file> <ouput image file> <color bit depth (Per chanel)>"
29+
exit 1
30+
fi
31+

image/image_resize.sh

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,5 +19,13 @@
1919
#// //
2020
#//////////////////////////////////////////////////////////////
2121

22-
convert -resize "$3" "$1" "$2"
22+
if (( $# >= 3 )); then
23+
for var in "$@"
24+
do
25+
convert -resize "$3" "$1" "$2"
26+
done
27+
else
28+
echo "Usage: ${0##*/} <input image file> <ouput image file> <size (in % or pixel)>"
29+
exit 1
30+
fi
2331

0 commit comments

Comments
 (0)