🍱 frontend/assets: Add image generation script and assets for multiple projects
- Created script `generate_images.nu` to automate WebP/JPEG-XL conversions with low-res placeholders. - Added new source image `data_hub_1.png`. - Generated WebP and JPEG-XL assets for projects: carplexity, data_hub, endolingual, icons, parva, and tiles. - Created both high-quality and low-resolution variants for all project assets.
This commit is contained in:
parent
d2affdf265
commit
1c8722912b
34 changed files with 28 additions and 0 deletions
28
crates/frontend/assets/generate_images.nu
Executable file
28
crates/frontend/assets/generate_images.nu
Executable file
|
@ -0,0 +1,28 @@
|
|||
#!/usr/bin/env nu
|
||||
|
||||
# Generate low-res placeholders and high-res WebP and JPEG-XL versions of images
|
||||
|
||||
let images = (ls ...(glob *.{png,jpg,jpeg}) | get name)
|
||||
|
||||
mkdir webp
|
||||
mkdir jxl
|
||||
|
||||
for image in $images {
|
||||
let base = ($image | path parse | get stem)
|
||||
let ext = ($image | path parse | get extension)
|
||||
|
||||
print $"Generating high-res WebP for ($image)"
|
||||
magick $image -quality 85 $"webp/($base).webp"
|
||||
|
||||
print $"Generating high-res JPEG-XL for ($image)"
|
||||
magick $image -quality 85 $"jxl/($base).jxl"
|
||||
|
||||
# Resize to 300px width, quality 20
|
||||
print $"Generating low-res placeholder for ($image)"
|
||||
magick $image -resize 300 -quality 20 $"webp/($base)_low.webp"
|
||||
|
||||
print $"Generating low-res JPEG-XL placeholder for ($image)"
|
||||
magick $image -resize 300 -quality 20 $"jxl/($base)_low.jxl"
|
||||
}
|
||||
|
||||
print "Generation complete. Check crates/frontend/assets/webp and crates/frontend/assets/jxl for new files."
|
Loading…
Add table
Add a link
Reference in a new issue