Différences

Ci-dessous, les différences entre deux révisions de la page.

Lien vers cette vue comparative

Les deux révisions précédentesRévision précédente
bash [Le 29/12/2025, 11:58] – [Création de scripts shell] 185.153.173.173bash [Le 29/12/2025, 13:28] (Version actuelle) – ancienne révision (Le 28/11/2025, 12:24) restaurée - voir recommandations krodelabestiole
Ligne 14: Ligne 14:
 ===== Utilisation avancée ===== ===== Utilisation avancée =====
  
-from PIL import Image, ImageFilter, ImageEnhance +==== Création de scripts shell ====
-import numpy as np +
-import math +
-from moviepy.editor import ImageSequenceClip +
- +
-# PARAMÈTRES +
-SIZE 1080 +
-DURATION 3      # secondes +
-FPS 30 +
-FRAMES DURATION * FPS +
- +
-logo = Image.open("logo.png").convert("RGBA"+
-logo = logo.resize((SIZE, SIZE), Image.LANCZOS) +
- +
-frames = [] +
- +
-for i in range(FRAMES): +
-    t = i / FRAMES   # 0 → presque 1 (jamais 1) +
- +
-    # Rotation (ne jamais atteindre 360°) +
-    angle = 360 * t +
- +
-    # Fond noir +
-    frame = Image.new("RGBA", (SIZE, SIZE), (0, 0, 0, 255)) +
- +
-    # Rotation du logo +
-    rotated = logo.rotate(angle, resample=Image.BICUBIC) +
- +
-    # Intensité parfaitement loopable (cosinus fermé) +
-    # 0.5 → 1 → 0.5 +
-    intensity = 0.5 + 0.5 * (1 - math.cos(2 * math.pi * t)) / 2 +
- +
-    # Glow blanc froid +
-    glow = rotated.filter(ImageFilter.GaussianBlur(radius=28)) +
-    glow = ImageEnhance.Brightness(glow).enhance(2.6 * intensity) +
-    glow = ImageEnhance.Color(glow).enhance(1.4) +
- +
-    # Fusion +
-    frame = Image.alpha_composite(frame, glow) +
-    frame = Image.alpha_composite(frame, rotated) +
- +
-    frames.append(np.array(frame.convert("RGB"))) +
- +
-Création vidéo MP4 +
-clip = ImageSequenceClip(frames, fps=FPS) +
-clip.write_videofile( +
-    "CDPM_lumiere_rotation_LOOP.mp4", +
-    codec="libx264", +
-    bitrate="12M", +
-    audio=False +
-+
- +
-print("MP4 parfaitement loopable généré ✔")+
  
 +  * Commencer par le [[:tutoriel:script_shell|tutoriel d'introduction aux scripts shell]] ou [[:projets:ecole:scripting:initiation_au_shell|Initiation au shell (cours fait par des Ubunteros)]]
 +  * [[https://abs.traduc.org/abs-fr/|Guide avancé d'écriture des scripts Bash]]
 +  
 ==== Séparateur de mot ==== ==== Séparateur de mot ====