This commit is contained in:
lw-everestlinux committed 2025-11-23 15:46:38 -05:00
1 parent 5582afe313
commit 409328ba12
59 files changed
+43

No files matched your search

BIN
View File
Binary file not shown.

After

Width:  |  Height:  |  Size: 28 KiB

View File
File renamed without changes.
View File
File renamed without changes.
BIN
View File
Binary file not shown.

After

Width:  |  Height:  |  Size: 34 KiB

File renamed without changes.
File renamed without changes.
File renamed without changes.
Binary file not shown.

After

Width:  |  Height:  |  Size: 5.4 MiB

File renamed without changes.
File renamed without changes.
Binary file not shown.

After

Width:  |  Height:  |  Size: 1.6 MiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.5 MiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 7.7 MiB

+43
View File
@@ -0,0 +1,43 @@
from PIL import Image
import numpy as np
# Everforest dark hard palette (you can adjust for soft/medium/light variants)
EVERFOREST_PALETTE = [
(235, 219, 178), # fg
(54, 61, 64), # bg0
(49, 56, 59), # bg1
(39, 46, 49), # bg2
(69, 133, 136), # aqua
(204, 36, 29), # red
(152, 151, 26), # yellow
(184, 187, 38), # green
(215, 153, 33), # orange
(177, 98, 134), # purple
(104, 157, 106), # dark green
(142, 192, 124), # light green
]
def closest_color(rgb, palette):
"""Find closest color in palette to given rgb."""
r, g, b = rgb
distances = [np.sqrt((r-pr)**2 + (g-pg)**2 + (b-pb)**2) for pr, pg, pb in palette]
return palette[int(np.argmin(distances))]
def everforestify_image(input_path: str, output_path: str):
img = Image.open(input_path).convert("RGB")
pixels = np.array(img)
# Vectorized mapping
flat_pixels = pixels.reshape(-1, 3)
mapped_pixels = np.array([closest_color(tuple(p), EVERFOREST_PALETTE) for p in flat_pixels])
new_pixels = mapped_pixels.reshape(pixels.shape).astype(np.uint8)
new_img = Image.fromarray(new_pixels, "RGB")
new_img.save(output_path)
if __name__ == "__main__":
# Example usage
everforestify_image("gothic2.jpg", "everforest_gothic2.jpg")
File renamed without changes.
File renamed without changes.
Binary file not shown.

After

Width:  |  Height:  |  Size: 3.2 MiB

File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
Binary file not shown.

After

Width:  |  Height:  |  Size: 349 KiB

File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
View File
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
View File
File renamed without changes.
File renamed without changes.
Binary file not shown.

After

Width:  |  Height:  |  Size: 350 KiB

File renamed without changes.
BIN
View File
Binary file not shown.

After

Width:  |  Height:  |  Size: 5.3 MiB

File renamed without changes.
BIN
View File
Binary file not shown.

After

Width:  |  Height:  |  Size: 4.6 MiB

File renamed without changes.
View File
File renamed without changes.
BIN
View File
Binary file not shown.

After

Width:  |  Height:  |  Size: 2.7 MiB

View File
File renamed without changes.
BIN
View File
Binary file not shown.

After

Width:  |  Height:  |  Size: 1.3 MiB

View File
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
BIN
View File
Binary file not shown.

After

Width:  |  Height:  |  Size: 117 KiB