fix(immersive): sample 90-100% of image for complete color representation

Rely on extreme blur to destroy details, not cropping.
This ensures all dominant colors (like blue sky) are captured.
This commit is contained in:
vicrodh committed 2026-02-01 11:39:32 -06:00
1 parent 8917049b00
commit 240ca09c6a
2 files changed
+5 -4

No files matched your search

@@ -99,8 +99,8 @@
const cropCtx = cropCanvas.getContext('2d');
if (!cropCtx) { isLoading = false; return; }
// Zoom factor: 1.1x to 1.6x (takes 62%-90% of image for more relevant colors)
const zoomFactor = 1.1 + rand() * 0.5;
// Zoom factor: 1.0x to 1.1x (takes 90%-100% for ALL colors)
const zoomFactor = 1.0 + rand() * 0.1;
const sourceSize = Math.min(img.width, img.height) / zoomFactor;
const maxOffset = Math.min(img.width, img.height) - sourceSize;
+3 -2
View File
@@ -60,8 +60,9 @@ function extractRandomCrop(
const rand = seededRandom(seed);
// Zoom factor: 1.1x to 1.6x (we take 62%-90% of the image for more relevant colors)
const zoomFactor = 1.1 + rand() * 0.5;
// Zoom factor: 1.0x to 1.1x (we take 90%-100% of the image for ALL colors)
// Rely on extreme blur to destroy details, not cropping
const zoomFactor = 1.0 + rand() * 0.1;
// Source region size (what portion of original image to take)
const sourceSize = Math.min(img.width, img.height) / zoomFactor;