Skip to content
Snippets Groups Projects
Verified Commit 6a5c01cf authored by Janne Mareike Koschinski's avatar Janne Mareike Koschinski
Browse files

build: updated dependencies and restructured project

parent 7310ae00
No related branches found
No related tags found
No related merge requests found
Pipeline #2764 passed
Showing
with 0 additions and 183 deletions
assets/images/dracula@335.png

59.3 KiB

assets/images/dracula@335.webp

56 KiB

assets/images/dracula@352.png

65 KiB

assets/images/dracula@352.webp

61.2 KiB

assets/images/dracula@532.png

109 KiB

assets/images/dracula@532.webp

100 KiB

assets/images/dracula@thumb.jpg

403 B

#!/bin/bash
cd $(dirname $(realpath -s ${0}))
image=${1}
resolutions=${2}
default_resolution=${3}
quality=${4}
thumb_quality=${5}
thumb_format=${6}
for resolution in ${resolutions}; do
./generate_resolution ${image} ${resolution} ${quality}
done
./generate_thumb ${image} ${default_resolution} ${thumb_quality} ${thumb_format}
\ No newline at end of file
#!/bin/bash
QUALITY=85
THUMB_QUALITY_PNG=70
THUMB_QUALITY_JPG=50
cd $(dirname $(realpath -s ${0}))
# Generate Images
themes="material_light material_dark solarized_light solarized_dark gruvbox_light gruvbox_dark amoled"
for image in ${themes}; do
./generate_image ${image} "220 266 335 352 532" 16 ${QUALITY} ${THUMB_QUALITY_JPG} jpg
done
./generate_image phone "220 300 400 520 640 800 1000 1220" 400 ${QUALITY} ${THUMB_QUALITY_PNG} png
./generate_image tablet "545 640 720 800 880 960 1090 1635 2180" 400 ${QUALITY} ${THUMB_QUALITY_PNG} none
./generate_image notifications "363 474 590" 16 ${QUALITY} ${THUMB_QUALITY_JPG} jpg
./generate_image desktop "363 474 590 726 948 1180" 16 ${QUALITY} ${THUMB_QUALITY_JPG} jpg
./generate_image themes "363 474 590 726 948 1180" 16 ${QUALITY} ${THUMB_QUALITY_JPG} jpg
#!/bin/bash
QUALITY=85
THUMB_QUALITY_PNG=70
THUMB_QUALITY_JPG=50
cd $(dirname $(realpath -s ${0}))
RULES=()
function generate_rule() {
image=${1}
resolutions=${2}
default_resolution=${3}
quality=${4}
thumb_quality=${5}
thumb_format=${6}
for resolution in ${resolutions}; do
RULES+=("${image}@${resolution}.png")
echo "${image}@${resolution}.png: ${image}.png" >> Makefile.wip
echo " \$(RESOLUTION) ${image} ${resolution} ${quality}" >> Makefile.wip
RULES+=("${image}@${resolution}.webp")
echo "${image}@${resolution}.webp: ${image}@${resolution}.png" >> Makefile.wip
echo " \$(RESOLUTION_WEBP) ${image} ${resolution} ${quality}" >> Makefile.wip
done
case ${thumb_format} in
"png")
RULES+=("${image}@thumb.png")
echo "${image}@thumb.png: ${image}.png" >> Makefile.wip
echo " \$(THUMB) ${image} ${default_resolution} ${thumb_quality} png" >> Makefile.wip
;;
"jpg")
RULES+=("${image}@thumb.jpg")
echo "${image}@thumb.jpg: ${image}.png" >> Makefile.wip
echo " \$(THUMB) ${image} ${default_resolution} ${thumb_quality} jpg" >> Makefile.wip
;;
"none")
RULES+=("${image}@thumb.png")
echo "${image}@thumb.png: ${image}.png" >> Makefile.wip
echo " \$(THUMB) ${image} ${default_resolution} ${thumb_quality} none" >> Makefile.wip
;;
*)
echo "Unknown format: $thumb_format"
exit 1
;;
esac
}
function finalize() {
echo -n "all:" >> Makefile
for rule in "${RULES[@]}"; do
echo -n " $rule" >> Makefile
done
echo >> Makefile
cat Makefile.wip >> Makefile
rm Makefile.wip
}
cat <<EOF > Makefile
RESOLUTION = \$(shell pwd)/generate_resolution.sh
RESOLUTION_WEBP = \$(shell pwd)/generate_resolution_webp.sh
THUMB = \$(shell pwd)/generate_thumb.sh
EOF
# Generate Images
themes="material_light material_dark solarized_light solarized_dark gruvbox_light gruvbox_dark amoled dracula"
for image in ${themes}; do
generate_rule ${image} "220 266 335 352 532" 16x ${QUALITY} ${THUMB_QUALITY_JPG} jpg
done
generate_rule phone "220 300 400 520 640 800 1000 1220" 16x16 ${QUALITY} 0 none
generate_rule tablet "545 640 720 800 880 960 1090 1635 2180" 16x16 ${QUALITY} 0 none
generate_rule notifications "363 474 590" 16x ${QUALITY} ${THUMB_QUALITY_JPG} jpg
generate_rule desktop "363 474 590 726 948 1180" 16x ${QUALITY} ${THUMB_QUALITY_JPG} jpg
finalize
#!/bin/bash
cd $(dirname $(realpath -s ${0}))
image=${1}
resolution=${2}
quality=${3}
convert ${image}.png -colorspace RGB -filter Lanczos -distort Resize ${resolution}x -colorspace sRGB ${image}@${resolution}.png
pngquant --quality ${quality} ${image}@${resolution}.png
mv ${image}@${resolution}-fs8.png ${image}@${resolution}.png
#!/bin/bash
cd $(dirname $(realpath -s ${0}))
image=${1}
resolution=${2}
quality=${3}
cwebp -lossless ${image}@${resolution}.png -o ${image}@${resolution}.webp
#!/bin/bash
cd $(dirname $(realpath -s ${0}))
function generate_thumb_jpg() {
image=${1}
default_resolution=${2}
quality=${3}
convert ${image}.png -colorspace RGB -filter Lanczos -distort Resize 16x -colorspace sRGB ${image}@thumb.png
convert ${image}@thumb.png -colorspace RGB -filter Lanczos -distort Resize ${default_resolution} -colorspace sRGB -quality ${quality} ${image}@thumb.jpg
rm ${image}@thumb.png
}
function generate_thumb_png() {
image=${1}
default_resolution=${2}
quality=${3}
convert ${image}.png -colorspace RGB -filter Lanczos -distort Resize 16x -colorspace sRGB ${image}@thumb.png
convert ${image}@thumb.png -colorspace RGB -filter Lanczos -distort Resize ${default_resolution} -colorspace sRGB ${image}@thumb.png
pngquant --quality ${quality} ${image}@thumb.png
mv ${image}@thumb-fs8.png ${image}@thumb.png
}
function generate_thumb_none() {
image=${1}
default_resolution=${2}
quality=${3}
convert -size ${default_resolution} xc:none ${image}@thumb.png
pngquant --quality ${quality} ${image}@thumb.png
mv ${image}@thumb-fs8.png ${image}@thumb.png
}
image=${1}
default_resolution=${2}
quality=${3}
format=${4}
case ${format} in
"png")
generate_thumb_png ${image} ${default_resolution} ${quality}
;;
"jpg")
generate_thumb_jpg ${image} ${default_resolution} ${quality}
;;
"none")
generate_thumb_none ${image} ${default_resolution} ${quality}
;;
*)
echo "Unknown format: $format"
exit 1
;;
esac
\ No newline at end of file
assets/images/gruvbox_dark@220.png

32.5 KiB

assets/images/gruvbox_dark@220.webp

30.6 KiB

assets/images/gruvbox_dark@266.png

42.6 KiB

assets/images/gruvbox_dark@266.webp

40.9 KiB

assets/images/gruvbox_dark@335.png

58.2 KiB

assets/images/gruvbox_dark@335.webp

55.1 KiB

assets/images/gruvbox_dark@352.png

61.1 KiB

0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment