hyprland-website/scripts/generate-blurred-images.sh

31 lines
1.5 KiB
Bash
Raw Normal View History

Update design - use Sveltekit (#28) * first push * feature cards, hall of fame * playing around * community slice * home * mobile home * wtf happend with the git * something * stuff * stuff * remove blur on nav on mobile * wall of fame, improve performance * always use current year for copyright * close navbar on navigation for mobile * improve performance community slice * improve performance features slice * prepare performance improvement for rice thumbnails * . * . * more stuff * new hero effect experiment * . * work * . * . * more stuf * hide discord profile image if image is not loaded yet * update links to rices * . * fix postinstall not running * . * remove quotes * remove .gitattributes * update readme * Footer: Fix bottom margin * HeroBackground: Remove images+animations * Remove discord * InstallSection: Change button label * Revert "Remove discord" This reverts commit 3e3eab848c71d24cbefca70f8108cc2ac7e843ea. * Revert "HeroBackground: Remove images+animations" This reverts commit 4979bf2a3942ae125a5e429eb14ab68690ee1531. * improve hero rice * small improvments * small css adjustments * update Hero * upgrade dependencies * fix prettier * improve navbar on mobile * add top ricers to community slice * improve hero * improve preview slice * add plugins section * Add OpenSus * set min width for quotes in discord profiles * update nix install command * improve patternbackground mouse follow * improve pattern mouse follow * fix play button for autoplay blocked users * pluginsSlice, sync videos playback state * add fullscreen button to videos * clean up package.json * slide pluginsSlice video on hover on desktop * PluginsSlice: small improvments * priotize loading logo * add meta tags * previewRice: make fullscreen button bigger * pluginSlice fix fullscreen btn with sliding * update readme * fix typo * ssr logo as svg Use the svg directly so that it does not need to get fetched anymore * pluginsSlice: animate in * communityslice: sort by size * communityslice: add a profile * walloffame cleanup * WallOfFame: Nicer wisdoms * add grain to gradients * decrease grain strength * remove unused imports * add space winners * small clean up * use aylur settings video * increase grain strength * fix grain path * contest: date as pill * famedrice: colored titles * update Aylurs video * pluginsSlice: decrease video gap * pluginsSlice: improve mobile padding * pluginSlice: improve play btn position * installSlice: improve padding on mobile * add flick0s rice as honorable mention * rename WoF to HoF * add Slackware * Revert "add Slackware" This reverts commit defc756cc6bc1549111e0d8e415545a107375bc9. * Revert "add flick0s rice as honorable mention" This reverts commit 8cffcad8cb330062bf6bedf230f7c6272fe79775. * add outfoxxeds plugin video * pluginSlice: update outfoxxed caption * pluginSlice: outfoxxed video thumb * pluginsSlice: refractor, add outfoxxed thumbnail * video: Fix autoplay detection for Firefox * Video: Fix poster size * reencode aylurs file bc firefox errors * PreviewRice: refactor * remove console.log * PluginsSlice: fix playback sync logic * update readme * fix typo * also use more modern encoding for videos * pluginsSlice: Improve outfoxxed caption * InstallSlice: Shorten NixOs command for formatting * HoF: Fix japane decorative title on mobile * PluginsSlice: Improve video display on mobile * PluginsSlice: Improve caption padding on mobile * PluginsSlice: outfoxxed all lowercase * fix typ * remove no-index * HoF: Update japanese wisdom * remove unused dependency * fix grammar * blurredImages: add shebang * HoF: Use data file to generate rices * use discord link as constant * heroBgTile: smooth fade-out of img * Video: Add pause button * pluginSlice: add slide in button * remove AV1 webm video and only use h264 mp4 * video: small play button plays video * pluginsSlice: nicer slide button * reeconde end_4 rice, delete unused AV1 video files * HeroBackground: use transition for artwork tiles
2023-11-25 21:31:55 +01:00
#!/usr/bin/env bash
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}"
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 )" )
# Boost the brightness if the image is very dark
brightness_boost=$( python -c "print( max( (1 - ($brightness / $brightness_threshold)) * 50 , 0) )" )
# Modify colors with LUT
magick convert -brightness-contrast ${brightness_boost}x40 -modulate 100,1000,100 "$filepath" "$generated_filename"
magick "$generated_filename" "./hald-clut.color.io.png" -hald-clut "$generated_filename"
# Also make them smaller to reduce file size
magick convert -modulate 100,250,100 -scale 10% -gaussian-blur 0x20 -resize 500% -quality 50 "$generated_filename" "$generated_filename"
# magick convert -scale 10% -brightness-contrast ${brightness_boost}x25 -modulate 100,500,100 -gaussian-blur 0x20 -resize 1000% "$filepath" "$generated_filename"
done