Fichier:CRT image creation animation.gif

CRT_image_creation_animation.gif(546 × 532 pixels, taille du fichier : 6,61 Mio, type MIME : image/gif, en boucle, 192 trames, 3,8 s)

Description

Description
Deutsch: Animation des Bildaufbaus bei einer Kathodenstrahlröhre mit Interlacing-Verfahren.
English: Animation of the image construction for a cathode ray tube with interlacing method.
Date
Source Travail personnel
Auteur Laserlicht

Code

#Path to Cairo Lib
import os
os.environ["PATH"] = r"D:\Programme\msys64\mingw64\bin" + os.pathsep + os.environ["PATH"]

#Imports
import drawSvg as draw
from PIL import Image
import numpy as np
import webbrowser

#Global Settings
in_img = "img3.jpg"
intensity_multiplicator = 0.990

#Image
im = Image.open(in_img)
pix = np.array(im)
pix = np.transpose(pix, (1, 0, 2))
intensity = np.arange(pix.shape[0] * pix.shape[1], dtype=np.float64).reshape(pix.shape[0], pix.shape[1])
intensity[:] = 0.0

def render(f):
    global im, intensity

    #Settings / Objects
    size = (600, 600)
    d = draw.Drawing(size[0], size[1], origin=(0, 0), displayInline=False)
    d.append(draw.Rectangle(0, 0, size[0], size[1], fill="#ffffff", fill_opacity=1.0))

    #Draw
    draw_area = (50, 50 + 100, (280/3) * 4, 280)
    gap = (draw_area[2] / pix.shape[0], draw_area[3] / pix.shape[1])

    #   Antenna
    gradient = draw.LinearGradient(draw_area[0], draw_area[1], draw_area[0] + draw_area[2], draw_area[1] + draw_area[3])
    gradient.addStop(0, '#aaaaaa', 1)
    gradient.addStop(1, '#eeeeee', 1)
    gradient = '#cccccc' #overwrite gradient -> disable, because better for gif

    p = draw.Path(stroke_width=2, stroke="#000000", fill=gradient, fill_opacity=1.0)
    p.M(280, 460)
    p.A(10, 10, 0, 0, 1, 300, 460)
    d.append(p)
    d.append(draw.Line(290, 470, 290 + 90, 470 + 90, stroke='black', stroke_width=2, fill='none'))
    d.append(draw.Circle(290 + 90, 470 + 90, 7, fill='black', stroke_width=2, stroke='black'))
    d.append(draw.Line(290, 470, 290 - 120, 470 + 120, stroke='black', stroke_width=2, fill='none'))
    d.append(draw.Circle(290 - 120, 470 + 120, 7, fill='black', stroke_width=2, stroke='black'))

    #   Foot
    p = draw.Path(stroke_width=2, stroke="#000000", fill=gradient, fill_opacity=1.0)
    p.M(290+100, 120)
    p.L(290+100+50, 120-50)
    p.L(290+100+20, 120)
    d.append(p)
    p = draw.Path(stroke_width=2, stroke="#000000", fill=gradient, fill_opacity=1.0)
    p.M(290-100, 120)
    p.L(290-100-50, 120-50)
    p.L(290-100-20, 120)
    d.append(p)

    #   TV housing
    d.append(draw.Rectangle(20, 20 + 100, 540, 340, rx=50, ry=50, fill=gradient, fill_opacity=1.0, stroke="#000000", stroke_width=2))

    #   Blackscreen
    d.append(draw.Rectangle(50, 50 + 100, (280/3)*4, 280, rx=10, ry=10, fill="#000000"))

    #   Display
    while f >= pix.shape[0] * pix.shape[1]: f -= pix.shape[0] * pix.shape[1]
    radius = min(gap[0], gap[1]) / 2
    intensity[:] *= intensity_multiplicator
    for x in range(pix.shape[0]):
        for y in range(pix.shape[1]):
            point_pos = (f % pix.shape[0], f // pix.shape[0])

            if point_pos[1] < pix.shape[1] / 2:
                y_pos = (point_pos[1] * 2 == y)
            else:
                y_pos = (((point_pos[1] - pix.shape[1] / 2) * 2) + 1 == y)

            if point_pos[0] == x and y_pos:
                color = "#ffffff"
                intensity[x, y] = 1.0
            else:
                color = tuple((pix[x][y] * intensity[x][y]).astype(int))
                color = '#%02x%02x%02x' % color
           
            d.append(draw.Circle(draw_area[0] + x * gap[0] + radius, draw_area[1] + draw_area[3] - y * gap[1] - radius, radius, fill=color))

    #   TV
    #       Screen (only Border)
    d.append(draw.Rectangle(50 - 5, 50 + 100 - 5, (280/3)*4 + 10, 280 + 10, rx=15, ry=15, fill="#000000", fill_opacity=0.0, stroke=gradient, stroke_width=10)) #hacky overdraw overlapping circles -> masks don't work...
    d.append(draw.Rectangle(50, 50 + 100, (280/3)*4, 280, rx=10, ry=10, fill="#000000", fill_opacity=0.0, stroke="#000000", stroke_width=2))

    #       Controls
    d.append(draw.Rectangle(75 + (280/3)*4, 130 + 100, 455 - (280/3)*4, 200, rx=10, ry=10, fill="#000000", fill_opacity=0.0, stroke="#000000", stroke_width=2))

    d.append(draw.Circle(75 + (280/3)*4 + 40, 130 + 100 + 160, 25, fill='#888888', stroke_width=2, stroke='black'))
    d.append(draw.Circle(75 + (280/3)*4 + 40, 130 + 100 + 90, 25, fill='#888888', stroke_width=2, stroke='black'))
    d.append(draw.Rectangle(75 + (280/3)*4 + 40, 130 + 100 + 160 - 5, 20, 10, rx=10, ry=10, fill="#888888", fill_opacity=0.0, stroke="#000000", stroke_width=2))
    d.append(draw.Rectangle(75 + (280/3)*4 + 40 - 5, 130 + 100 + 90, 10, 20, rx=10, ry=10, fill="#888888", fill_opacity=0.0, stroke="#000000", stroke_width=2))

    #       Speaker
    for i in range(6):
        p = draw.Path(stroke_width=2, stroke="#000000", fill='black', fill_opacity=0.0)
        p.M(75 + (280/3)*4, 130 + 100 - 20 - 10 * i)
        p.H(75 + (280/3)*4 + 80)
        d.append(p)

    #Output
    d.setRenderSize(size[0], size[1])

    return d

#Prefill Intensity Values
for i in range(pix.shape[0] * pix.shape[1]):
    render(i)

#Render to Images
with draw.animate_video("video.tiff", render) as anim:
    for i in range(pix.shape[0] * pix.shape[1]):
        anim.draw_frame(i)

#Render to SVG/PNG
#d = render(0)
#d.saveSvg("a.svg")
#d.savePng("a.png")

#View
webbrowser.open('file://' + os.path.realpath("video.tiff"))
input()

Conditions d’utilisation

Image:

Moi, en tant que détenteur des droits d’auteur sur cette œuvre, je la publie sous la licence suivante :
w:fr:Creative Commons
paternité partage à l’identique
Vous êtes libre :
  • de partager – de copier, distribuer et transmettre cette œuvre
  • d’adapter – de modifier cette œuvre
Sous les conditions suivantes :
  • paternité – Vous devez donner les informations appropriées concernant l'auteur, fournir un lien vers la licence et indiquer si des modifications ont été faites. Vous pouvez faire cela par tout moyen raisonnable, mais en aucune façon suggérant que l’auteur vous soutient ou approuve l’utilisation que vous en faites.
  • partage à l’identique – Si vous modifiez, transformez, ou vous basez sur cette œuvre, vous devez distribuer votre contribution sous la même licence ou une licence compatible avec celle de l’original.

Source:

Ce fichier est distribué sous Licence Expat, parfois connu sous le nom Licence MIT :

Droits d’auteur © Laserlicht

La permission est donnée, gratuitement, à n'importe quelle personne d'obtenir une copie de ce logiciel et des fichiers de documentation associés (le "Logiciel"), d'utiliser le Logiciel sans restriction, ce qui inclut sans limite le droit d'utiliser, copier, modifier, fusionner, publier, distribuer, sous-licencier et / ou vendre des copies du Logiciel, et de permettre aux personnes auxquelles le Logiciel est fourni de faire de même, aux conditions suivantes :

La notice de copyright ci-dessus et cette notice doivent être incluses dans toutes les copies ou portions substantielles du Logiciel.

The Software is provided "as is", without warranty of any kind, express or implied, including but not limited to the warranties of merchantability, fitness for a particular purpose and noninfringement. In no event shall the authors or copyright holders be liable for any claim, damages or other liability, whether in an action of contract, tort or otherwise, arising from, out of or in connection with the Software or the use or other dealings in the Software.


À l'attention de celui qui téléverse : la licence MIT dispose de différentes versions, vous pouvez spécifier la licence plus précisément. Cliquez sur {{MIT}} pour voir les détails.

Cette image a été promue au rang d'image de qualité d'après les critères du Guide des images.

العربية  جازايرية  беларуская  беларуская (тарашкевіца)  български  বাংলা  català  čeština  Cymraeg  Deutsch  Schweizer Hochdeutsch  Zazaki  Ελληνικά  English  Esperanto  español  eesti  euskara  فارسی  suomi  français  galego  עברית  हिन्दी  hrvatski  magyar  հայերեն  Bahasa Indonesia  italiano  日本語  Jawa  ქართული  한국어  kurdî  Lëtzebuergesch  lietuvių  македонски  മലയാളം  मराठी  Bahasa Melayu  Nederlands  Norfuk / Pitkern  polski  português  português do Brasil  rumantsch  română  русский  sicilianu  slovenčina  slovenščina  shqip  српски / srpski  svenska  தமிழ்  తెలుగు  ไทย  Tagalog  Türkçe  toki pona  українська  vèneto  Tiếng Việt  中文  中文(简体)  中文(繁體)  +/−

Légendes

Ajoutez en une ligne la description de ce que représente ce fichier

Éléments décrits dans ce fichier

dépeint

image/gif

8d26037a7a752fe6aef5f771c3387417437262e1

6 930 521 octet

3,840000000000003 seconde

532 pixel

546 pixel

Historique du fichier

Cliquer sur une date et heure pour voir le fichier tel qu'il était à ce moment-là.

Date et heureVignetteDimensionsUtilisateurCommentaire
actuel7 novembre 2021 à 20:42Vignette pour la version du 7 novembre 2021 à 20:42546 × 532 (6,61 Mio)Laserlichtcomment edit
7 novembre 2021 à 19:41Vignette pour la version du 7 novembre 2021 à 19:41546 × 532 (6,61 Mio)Laserlichtwhite BG
7 novembre 2021 à 19:39Vignette pour la version du 7 novembre 2021 à 19:39546 × 532 (6,95 Mio)LaserlichtUploaded own work with UploadWizard

Usage global du fichier

Les autres wikis suivants utilisent ce fichier :

Métadonnées