Différences
Ci-dessous, les différences entre deux révisions de la page.
| Prochaine révision | Révision précédente | ||
| python:images [2020/04/24 16:06] – créée phsw | python:images [2021/04/04 17:01] (Version actuelle) – modification externe 127.0.0.1 | ||
|---|---|---|---|
| Ligne 1: | Ligne 1: | ||
| - | ====== Manipulation d' | + | ====== Manipulation d' |
| Ligne 14: | Ligne 14: | ||
| dst.paste(im1, | dst.paste(im1, | ||
| dst.save(' | dst.save(' | ||
| + | </ | ||
| + | |||
| + | --------------------------------- | ||
| + | |||
| + | ==== Lecture d' | ||
| + | |||
| + | [[https:// | ||
| + | |||
| + | <code python> | ||
| + | from PIL import Image | ||
| + | import numpy as np | ||
| + | |||
| + | img_pil = Image.open(" | ||
| + | img = np.array(img_pil) | ||
| + | </ | ||
| + | |||
| + | Si l' | ||
| + | |||
| + | |||
| + | -------------------------------- | ||
| + | ==== Affichage d'une image ==== | ||
| + | |||
| + | <code python> | ||
| + | from PIL import Image | ||
| + | import numpy as np | ||
| + | import matplotlib.pyplot as plt | ||
| + | |||
| + | img_pil = Image.open(" | ||
| + | img = np.array(img_pil) | ||
| + | |||
| + | plt.imshow(img) | ||
| + | plt.show() | ||
| + | </ | ||
| + | |||
| + | Si l' | ||
| + | <code python> | ||
| + | plt.imshow(img, | ||
| + | </ | ||
| + | |||
| + | Il est possible d' | ||
| + | <code python> | ||
| + | plt.axhline(y=black_keys_line) | ||
| + | plt.axvline(x=x, | ||
| </ | </ | ||