diff --git a/scripts/generate-blurred-images.sh b/scripts/generate-blurred-images.sh index f6d8896..f580b4f 100755 --- a/scripts/generate-blurred-images.sh +++ b/scripts/generate-blurred-images.sh @@ -1,8 +1,22 @@ -find "./static/imgs/ricing_competitions/" -type f \ - \( -iname "*.jpg" -o -iname "*.png" -o -iname "*.gif" -o -iname "*.bmp" -o -iname "*.jpeg" \) -print0 | +parent_path=$( cd "$(dirname "${BASH_SOURCE[0]}")" ; pwd -P ) + +cd "$parent_path" + +find "../static/imgs/ricing_competitions/" -type f \ + \( -iname "*.jpg" -o -iname "*.png" -o -iname "*.gif" -o -iname "*.bmp" -o -iname "*.jpeg" -o -iname "*.webp" \) -not -name "generated_*" -print0 | while IFS= read -r -d '' filepath; do + echo "$filepath" gets blurred + directory=$(dirname "$filepath") filename=$(basename "$filepath") generated_filename="${directory}/generated_${filename}" - magick convert -scale 10% -gaussian-blur 0x1 -modulate 100,300,100 -resize 1000% "$filepath" "$generated_filename" + brightness=$( convert $filepath -colorspace Gray -format "%[mean]" info: ) + max_brightness="65535" # The possible maximum brightness possible from the previous command + brightness_threshold=$( python -c "print( $max_brightness * 0.5 )" ) + + # Adjust the brightness, make it brighter if dark, otherwise lighten it + brightness_boost=$( python -c "print( (1 - ($brightness / $brightness_threshold)) * 50 )" ) + + magick convert -scale 10% -brightness-contrast ${brightness_boost}x20 -modulate 100,500,100 -gaussian-blur 0x20 -resize 1000% "$filepath" "$generated_filename" + # magick "$generated_filename" "./hald-clut.png" -hald-clut "$generated_filename" done diff --git a/src/routes/wall_of_fame/+page.svelte b/src/routes/wall_of_fame/+page.svelte index 29dba34..66ccf56 100755 --- a/src/routes/wall_of_fame/+page.svelte +++ b/src/routes/wall_of_fame/+page.svelte @@ -21,56 +21,66 @@ pretitel="#1" dotfilesLink="https://github.com/end-4/dots-hyprland/tree/novelknock" creatorProfilePicture="https://avatars.githubusercontent.com/u/97237370?s=24&v=4" - thumbnail="/imgs/ricingcomp2/end_4.jpg" - blurredThumbnail="/imgs/ricingcomp2/end_4.jpg" + thumbnail="/imgs/ricing_competitions/2/end_4.webp" /> - + + + diff --git a/src/routes/wall_of_fame/FamedRice.svelte b/src/routes/wall_of_fame/FamedRice.svelte index 1bc602b..c2c9b58 100755 --- a/src/routes/wall_of_fame/FamedRice.svelte +++ b/src/routes/wall_of_fame/FamedRice.svelte @@ -9,10 +9,18 @@ export let creatorProfilePicture /** @type {string} */ export let thumbnail - /** @type {string} */ - export let blurredThumbnail + /** + * Specify the blurred background image to be used. + * Defaults to `"generated_"` + * @type {string | undefined} */ + export let blurredThumbnail = undefined /** @type {string} */ export let pretitel + + let background = + blurredThumbnail ?? + // Get the `generated_` if blurredThumbnail is not set manually + `${thumbnail.substring(0, thumbnail.lastIndexOf('/'))}/generated_${thumbnail.split('/').at(-1)}`
@@ -41,11 +49,48 @@ class="rounded-lg hover:scale-[1.01] duration-300 transition-transform w-full" /> - + + +
+ + diff --git a/static/imgs/ricing_competitions/1/amadeus.png b/static/imgs/ricing_competitions/1/amadeus.png deleted file mode 100755 index 9f48c7d..0000000 Binary files a/static/imgs/ricing_competitions/1/amadeus.png and /dev/null differ diff --git a/static/imgs/ricing_competitions/1/amadeus.webp b/static/imgs/ricing_competitions/1/amadeus.webp new file mode 100755 index 0000000..feb0868 Binary files /dev/null and b/static/imgs/ricing_competitions/1/amadeus.webp differ diff --git a/static/imgs/ricing_competitions/1/flafy.png b/static/imgs/ricing_competitions/1/flafy.png deleted file mode 100755 index dc45274..0000000 Binary files a/static/imgs/ricing_competitions/1/flafy.png and /dev/null differ diff --git a/static/imgs/ricing_competitions/1/flafy.webp b/static/imgs/ricing_competitions/1/flafy.webp new file mode 100755 index 0000000..a821db3 Binary files /dev/null and b/static/imgs/ricing_competitions/1/flafy.webp differ diff --git a/static/imgs/ricing_competitions/1/flicko.png b/static/imgs/ricing_competitions/1/flicko.png deleted file mode 100755 index 743707f..0000000 Binary files a/static/imgs/ricing_competitions/1/flicko.png and /dev/null differ diff --git a/static/imgs/ricing_competitions/1/flicko.webp b/static/imgs/ricing_competitions/1/flicko.webp new file mode 100755 index 0000000..808626c Binary files /dev/null and b/static/imgs/ricing_competitions/1/flicko.webp differ diff --git a/static/imgs/ricing_competitions/1/lauroro.jpg b/static/imgs/ricing_competitions/1/lauroro.jpg deleted file mode 100755 index be5ab68..0000000 Binary files a/static/imgs/ricing_competitions/1/lauroro.jpg and /dev/null differ diff --git a/static/imgs/ricing_competitions/1/lauroro.webp b/static/imgs/ricing_competitions/1/lauroro.webp new file mode 100755 index 0000000..22d60ec Binary files /dev/null and b/static/imgs/ricing_competitions/1/lauroro.webp differ diff --git a/static/imgs/ricing_competitions/1/lyasm.png b/static/imgs/ricing_competitions/1/lyasm.png deleted file mode 100755 index 5c9559c..0000000 Binary files a/static/imgs/ricing_competitions/1/lyasm.png and /dev/null differ diff --git a/static/imgs/ricing_competitions/1/lyasm.webp b/static/imgs/ricing_competitions/1/lyasm.webp new file mode 100755 index 0000000..48dfe7e Binary files /dev/null and b/static/imgs/ricing_competitions/1/lyasm.webp differ diff --git a/static/imgs/ricing_competitions/2/day-night.png b/static/imgs/ricing_competitions/2/day-night.png deleted file mode 100755 index 02557d4..0000000 Binary files a/static/imgs/ricing_competitions/2/day-night.png and /dev/null differ diff --git a/static/imgs/ricing_competitions/2/day-night.webp b/static/imgs/ricing_competitions/2/day-night.webp new file mode 100755 index 0000000..452813c Binary files /dev/null and b/static/imgs/ricing_competitions/2/day-night.webp differ diff --git a/static/imgs/ricing_competitions/2/end_4.jpg b/static/imgs/ricing_competitions/2/end_4.jpg deleted file mode 100755 index 4c0634e..0000000 Binary files a/static/imgs/ricing_competitions/2/end_4.jpg and /dev/null differ diff --git a/static/imgs/ricing_competitions/2/end_4.webp b/static/imgs/ricing_competitions/2/end_4.webp new file mode 100755 index 0000000..1381132 Binary files /dev/null and b/static/imgs/ricing_competitions/2/end_4.webp differ diff --git a/static/imgs/ricing_competitions/2/flafy.png b/static/imgs/ricing_competitions/2/flafy.png deleted file mode 100755 index 970c5db..0000000 Binary files a/static/imgs/ricing_competitions/2/flafy.png and /dev/null differ diff --git a/static/imgs/ricing_competitions/2/flafy.webp b/static/imgs/ricing_competitions/2/flafy.webp new file mode 100755 index 0000000..4f34409 Binary files /dev/null and b/static/imgs/ricing_competitions/2/flafy.webp differ