-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathtest_enc.sh
More file actions
executable file
·32 lines (25 loc) · 811 Bytes
/
test_enc.sh
File metadata and controls
executable file
·32 lines (25 loc) · 811 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
#!/usr/bin/sh
raw_dir="test/raw"
enc_dir="test/encoded"
qoi_dir="test/qoi"
### Encode RGB images
for file in $raw_dir/rgb/*; do
filename=$(basename "$file" .rgb)
## My encoder
./qoify -e --width 600 --height 400 --no-alpha "$file" "$enc_dir/rgb/$filename.qoi"
## Official QOI encoder
# The official encoder takes in png images, so convert accordingly first
convert -size 600x400 -depth 8 "rgb:$file" tmp.png
qoiconv tmp.png "$qoi_dir/rgb/$filename.qoi"
rm tmp.png
done;
### Encode RGBA images
for file in $raw_dir/rgba/*; do
filename=$(basename "$file" .rgba)
## My encoder
./qoify -e --width 600 --height 400 "$file" "$enc_dir/rgba/$filename.qoi"
## Official QOI encoder
convert -size 600x400 -depth 8 "rgba:$file" tmp.png
qoiconv tmp.png "$qoi_dir/rgba/$filename.qoi"
rm tmp.png
done;