mirror of
https://github.com/Faraphel/Atlas-Install.git
synced 2025-07-03 03:08:29 +02:00
fixed image patch operation of type "image" that would not affect the final image
This commit is contained in:
parent
91d44de46e
commit
6831b18c0a
7 changed files with 24 additions and 13 deletions
|
@ -2,6 +2,7 @@
|
|||
"operation": {
|
||||
"img-generate": {
|
||||
"layers": [
|
||||
{"type": "color", "color": [0, 0, 0]},
|
||||
{"type": "image", "image_path": "files/Boot/Strap/bootscreen-base.png"},
|
||||
{"type": "text", "x": 0.01, "y": 0.00, "text": "Mario Kart Wii - Faraphel", "font_size": 0.04, "color": [100, 100, 100], "font_path": "files/Boot/Strap/CenturyGothicBold.ttf"},
|
||||
{"type": "text", "x": 0.10, "y": 0.06, "text": "Elke track heeft een score tussen 1 en 5 sterren", "font_size": 0.045, "color": [255, 180, 0], "font_path": "files/Boot/Strap/CenturyGothicBold.ttf"},
|
||||
|
|
|
@ -2,6 +2,7 @@
|
|||
"operation": {
|
||||
"img-generate": {
|
||||
"layers": [
|
||||
{"type": "color", "color": [0, 0, 0]},
|
||||
{"type": "image", "image_path": "files/Boot/Strap/bootscreen-base.png"},
|
||||
{"type": "text", "x": 0.01, "y": 0.00, "text": "Mario Kart Wii - Faraphel", "font_size": 0.04, "color": [100, 100, 100], "font_path": "files/Boot/Strap/CenturyGothicBold.ttf"},
|
||||
{"type": "text", "x": 0.10, "y": 0.06, "text": "Every track has a score between 1 and 5 stars", "font_size": 0.045, "color": [255, 180, 0], "font_path": "files/Boot/Strap/CenturyGothicBold.ttf"},
|
||||
|
|
|
@ -2,6 +2,7 @@
|
|||
"operation": {
|
||||
"img-generate": {
|
||||
"layers": [
|
||||
{"type": "color", "color": [0, 0, 0]},
|
||||
{"type": "image", "image_path": "files/Boot/Strap/bootscreen-base.png"},
|
||||
{"type": "text", "x": 0.01, "y": 0.00, "text": "Mario Kart Wii - Faraphel", "font_size": 0.04, "color": [100, 100, 100], "font_path": "files/Boot/Strap/CenturyGothicBold.ttf"},
|
||||
{"type": "text", "x": 0.10, "y": 0.06, "text": "Cada pista tiene una puntuación entre 1 y 5 estrellas", "font_size": 0.045, "color": [255, 180, 0], "font_path": "files/Boot/Strap/CenturyGothicBold.ttf"},
|
||||
|
|
|
@ -2,6 +2,7 @@
|
|||
"operation": {
|
||||
"img-generate": {
|
||||
"layers": [
|
||||
{"type": "color", "color": [0, 0, 0]},
|
||||
{"type": "image", "image_path": "files/Boot/Strap/bootscreen-base.png"},
|
||||
{"type": "text", "x": 0.01, "y": 0.00, "text": "Mario Kart Wii - Faraphel", "font_size": 0.04, "color": [100, 100, 100], "font_path": "files/Boot/Strap/CenturyGothicBold.ttf"},
|
||||
{"type": "text", "x": 0.10, "y": 0.06, "text": "Chaque course possède une note allant de 1 à 5 étoiles", "font_size": 0.045, "color": [255, 180, 0], "font_path": "files/Boot/Strap/CenturyGothicBold.ttf"},
|
||||
|
|
|
@ -2,6 +2,7 @@
|
|||
"operation": {
|
||||
"img-generate": {
|
||||
"layers": [
|
||||
{"type": "color", "color": [0, 0, 0]},
|
||||
{"type": "image", "image_path": "files/Boot/Strap/bootscreen-base.png"},
|
||||
{"type": "text", "x": 0.01, "y": 0.00, "text": "Mario Kart Wii - Faraphel", "font_size": 0.04, "color": [100, 100, 100], "font_path": "files/Boot/Strap/CenturyGothicBold.ttf"},
|
||||
{"type": "text", "x": 0.10, "y": 0.06, "text": "Jeder track hat eine Punktzahl zwischen 1 und 5 sternen", "font_size": 0.045, "color": [255, 180, 0], "font_path": "files/Boot/Strap/CenturyGothicBold.ttf"},
|
||||
|
|
|
@ -2,6 +2,7 @@
|
|||
"operation": {
|
||||
"img-generate": {
|
||||
"layers": [
|
||||
{"type": "color", "color": [0, 0, 0]},
|
||||
{"type": "image", "image_path": "files/Boot/Strap/bootscreen-base.png"},
|
||||
{"type": "text", "x": 0.01, "y": 0.00, "text": "Mario Kart Wii - Faraphel", "font_size": 0.04, "color": [100, 100, 100], "font_path": "files/Boot/Strap/CenturyGothicBold.ttf"},
|
||||
{"type": "text", "x": 0.10, "y": 0.06, "text": "Ogni traccia ha un punteggio compreso tra 1 e 5 stelle", "font_size": 0.045, "color": [255, 180, 0], "font_path": "files/Boot/Strap/CenturyGothicBold.ttf"},
|
||||
|
|
|
@ -118,12 +118,11 @@ class PatchOperation:
|
|||
type = "color"
|
||||
|
||||
def __init__(self, color: tuple[int] = (0,), x1: int | float = 0, y1: int | float = 0,
|
||||
x2: int | float = 1,
|
||||
y2: int | float = 1):
|
||||
self.x1: int = x1
|
||||
self.y1: int = y1
|
||||
self.x2: int = x2
|
||||
self.y2: int = y2
|
||||
x2: int | float = 1.0, y2: int | float = 1.0):
|
||||
self.x1: int | float = x1
|
||||
self.y1: int | float = y1
|
||||
self.x2: int | float = x2
|
||||
self.y2: int | float = y2
|
||||
self.color: tuple[int] = tuple(color)
|
||||
|
||||
def patch_image(self, patch: "Patch", image: Image.Image):
|
||||
|
@ -138,12 +137,12 @@ class PatchOperation:
|
|||
"""
|
||||
type = "image"
|
||||
|
||||
def __init__(self, image_path: str, x1: int | float = 0, y1: int | float = 0, x2: int | float = 1,
|
||||
y2: int | float = 1):
|
||||
self.x1: int = x1
|
||||
self.y1: int = y1
|
||||
self.x2: int = x2
|
||||
self.y2: int = y2
|
||||
def __init__(self, image_path: str, x1: int | float = 0, y1: int | float = 0,
|
||||
x2: int | float = 1.0, y2: int | float = 1.0):
|
||||
self.x1: int | float = x1
|
||||
self.y1: int | float = y1
|
||||
self.x2: int | float = x2
|
||||
self.y2: int | float = y2
|
||||
self.image_path: str = image_path
|
||||
|
||||
def patch_image(self, patch: "Patch", image: Image.Image) -> Image.Image:
|
||||
|
@ -152,7 +151,13 @@ class PatchOperation:
|
|||
if not layer_image_path.is_relative_to(patch.path):
|
||||
raise PathOutsidePatch(layer_image_path, patch.path)
|
||||
|
||||
layer_image = Image.open(layer_image_path).resize(self.get_bbox_size(image)).convert("RGBA")
|
||||
layer_image = Image.open(
|
||||
layer_image_path.resolve()
|
||||
).resize(
|
||||
self.get_bbox_size(image)
|
||||
).convert(
|
||||
"RGBA"
|
||||
)
|
||||
|
||||
image.paste(
|
||||
layer_image,
|
||||
|
|
Loading…
Reference in a new issue