Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Split large news banners into 1x and 2x versions #12641

Merged
merged 1 commit into from
Jan 7, 2025

Conversation

Walavouchey
Copy link
Member

@Walavouchey Walavouchey commented Jan 6, 2025

scaled down images that don't have 2x versions where width >= 1800 (arbitrary) by half, while renaming the original versions with @2x suffixes

excluding some old images that weren't designed to be banners, such as

  • wiki/shared/news/banners/TWC_2015.png
  • wiki/shared/news/banners/owc_2014.png

csv file of news banners missing 2x versions

nushell script
let large_banners = open missing_2x.csv | into value
    | where not is_external
    | where width >= 1800
    | where path !~ "TWC_2015.png"
    | where path !~ "owc_2014.png"
    | where path !~ "combat-championship"

for row in $large_banners {
    let p = $row.path | path parse
    let path_2x = $"($p.parent)/($p.stem)@2x.($p.extension)"
    mv $row.path $path_2x
    ffmpeg -v error -i $path_2x -q 2 -vf scale=w=in_w/2:h=-1 $row.path
}

# this one is excessively large for some reason (3697x947)
mv wiki/shared/news/2023-11-20-the-first-osu-manga-osu-combat-championship/banner.jpg wiki/shared/news/2023-11-20-the-first-osu-manga-osu-combat-championship/banner-hq.jpg
ffmpeg -v error -i wiki/shared/news/2023-11-20-the-first-osu-manga-osu-combat-championship/banner-hq.jpg -vf scale=w=2000:h=-1 wiki/shared/news/2023-11-20-the-first-osu-manga-osu-combat-championship/[email protected]
ffmpeg -v error -i wiki/shared/news/2023-11-20-the-first-osu-manga-osu-combat-championship/banner-hq.jpg -vf scale=w=1000:h=-1 wiki/shared/news/2023-11-20-the-first-osu-manga-osu-combat-championship/banner.jpg
rm wiki/shared/news/2023-11-20-the-first-osu-manga-osu-combat-championship/banner-hq.jpg

@peppy peppy merged commit 5de0fe1 into ppy:master Jan 7, 2025
5 checks passed
@Walavouchey Walavouchey deleted the downscale-news-banners branch January 7, 2025 09:34
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants