website: increase placeholder resolution from 32px to 64px
4x the pixel count for sharper pixelated placeholders. All files still under 4KB so Vite inlines them as base64.
@@ -2,7 +2,7 @@
|
|||||||
* Generate pixelated placeholder images for the website.
|
* Generate pixelated placeholder images for the website.
|
||||||
*
|
*
|
||||||
* Scans website/public/ for all image files (png, jpg, jpeg, webp) and
|
* Scans website/public/ for all image files (png, jpg, jpeg, webp) and
|
||||||
* generates a tiny 32px-wide version into src/assets/placeholders/.
|
* generates a tiny 64px-wide version into src/assets/placeholders/.
|
||||||
* When displayed at full size with CSS `image-rendering: pixelated`
|
* When displayed at full size with CSS `image-rendering: pixelated`
|
||||||
* (nearest-neighbor / point sampling), these produce a crisp mosaic effect.
|
* (nearest-neighbor / point sampling), these produce a crisp mosaic effect.
|
||||||
*
|
*
|
||||||
@@ -24,7 +24,7 @@ import fs from "node:fs";
|
|||||||
const PUBLIC_DIR = path.resolve(import.meta.dirname, "../public");
|
const PUBLIC_DIR = path.resolve(import.meta.dirname, "../public");
|
||||||
const OUTPUT_DIR = path.resolve(import.meta.dirname, "../src/assets/placeholders");
|
const OUTPUT_DIR = path.resolve(import.meta.dirname, "../src/assets/placeholders");
|
||||||
const PLACEHOLDER_PREFIX = "placeholder-";
|
const PLACEHOLDER_PREFIX = "placeholder-";
|
||||||
const PLACEHOLDER_WIDTH = 32;
|
const PLACEHOLDER_WIDTH = 64;
|
||||||
const IMAGE_EXTENSIONS = new Set([".png", ".jpg", ".jpeg", ".webp"]);
|
const IMAGE_EXTENSIONS = new Set([".png", ".jpg", ".jpeg", ".webp"]);
|
||||||
|
|
||||||
async function main() {
|
async function main() {
|
||||||
|
|||||||
|
Before Width: | Height: | Size: 1.1 KiB After Width: | Height: | Size: 3.3 KiB |
|
Before Width: | Height: | Size: 636 B After Width: | Height: | Size: 2.3 KiB |
|
Before Width: | Height: | Size: 1.1 KiB After Width: | Height: | Size: 3.3 KiB |
|
Before Width: | Height: | Size: 1.2 KiB After Width: | Height: | Size: 3.7 KiB |