feat: 🎉 Initial commit
This commit is contained in:
commit
7e5e5dc1bd
3
debug.py
Normal file
3
debug.py
Normal file
@ -0,0 +1,3 @@
|
||||
for x in range(30):
|
||||
for y in range(30):
|
||||
print("Hello, x =" + str(x) + " et y = " + str(y))
|
BIN
robot.jpeg
Normal file
BIN
robot.jpeg
Normal file
Binary file not shown.
After Width: | Height: | Size: 73 KiB |
115
traitementImage.ipynb
Normal file
115
traitementImage.ipynb
Normal file
@ -0,0 +1,115 @@
|
||||
{
|
||||
"cells": [
|
||||
{
|
||||
"cell_type": "code",
|
||||
"execution_count": null,
|
||||
"id": "initial_id",
|
||||
"metadata": {
|
||||
"collapsed": true
|
||||
},
|
||||
"outputs": [],
|
||||
"source": [
|
||||
"from PIL import Image # Ouvrir le module PIP et import le package Image\n",
|
||||
"Img = Image.open(\"robot.jpeg\") # Assigne a la variable image l'image du robot\n",
|
||||
"rouge, vert, bleu = Img.getpixel((150, 200))\n",
|
||||
"print(rouge, vert, bleu)"
|
||||
]
|
||||
},
|
||||
{
|
||||
"cell_type": "code",
|
||||
"outputs": [],
|
||||
"source": [
|
||||
"Img.putpixel((150, 150), (255, 0, 0))\n",
|
||||
"Img.show()"
|
||||
],
|
||||
"metadata": {
|
||||
"collapsed": false
|
||||
},
|
||||
"id": "25b5db5c47e1e11c",
|
||||
"execution_count": null
|
||||
},
|
||||
{
|
||||
"cell_type": "code",
|
||||
"outputs": [],
|
||||
"source": [
|
||||
"for x in range(30):\n",
|
||||
" for y in range(30):\n",
|
||||
" rouge, vert, bleu = Img.getpixel((10*x, 10*y))\n",
|
||||
" print(rouge, vert, bleu)"
|
||||
],
|
||||
"metadata": {
|
||||
"collapsed": false
|
||||
},
|
||||
"id": "ef62b99d1a7ad0ba",
|
||||
"execution_count": null
|
||||
},
|
||||
{
|
||||
"cell_type": "code",
|
||||
"outputs": [],
|
||||
"source": [
|
||||
"for x in range(30):\n",
|
||||
" for y in range(30):\n",
|
||||
" Img.putpixel((10*x, 10*y), (255, 0, 0)) #mets la couleur rouge\n",
|
||||
"Img.show()"
|
||||
],
|
||||
"metadata": {
|
||||
"collapsed": false
|
||||
},
|
||||
"id": "b133149a00eff26",
|
||||
"execution_count": null
|
||||
},
|
||||
{
|
||||
"cell_type": "code",
|
||||
"outputs": [],
|
||||
"source": [
|
||||
"for x in range(30):\n",
|
||||
" for y in range(30):\n",
|
||||
" rouge, vert, bleu = Img.getpixel((10*x, 10*y))\n",
|
||||
" Img.putpixel((10*x, 10*y), (255-rouge, 255-vert, 255-bleu)) #mets la couleur rouge\n",
|
||||
"Img.show()"
|
||||
],
|
||||
"metadata": {
|
||||
"collapsed": false
|
||||
},
|
||||
"id": "2ae2505aa4aff998",
|
||||
"execution_count": null
|
||||
},
|
||||
{
|
||||
"cell_type": "code",
|
||||
"outputs": [],
|
||||
"source": [
|
||||
"for x in range(626):\n",
|
||||
" for y in range(626):\n",
|
||||
" rouge, vert, bleu = Img.getpixel((x, y))\n",
|
||||
" Img.putpixel((x, y), (255-rouge, 255-vert, 255-bleu)) # remplacer ici pour noir / blanc\n",
|
||||
"Img.show()"
|
||||
],
|
||||
"metadata": {
|
||||
"collapsed": false
|
||||
},
|
||||
"id": "8907db31c8a6d1e4",
|
||||
"execution_count": null
|
||||
}
|
||||
],
|
||||
"metadata": {
|
||||
"kernelspec": {
|
||||
"display_name": "Python 3",
|
||||
"language": "python",
|
||||
"name": "python3"
|
||||
},
|
||||
"language_info": {
|
||||
"codemirror_mode": {
|
||||
"name": "ipython",
|
||||
"version": 2
|
||||
},
|
||||
"file_extension": ".py",
|
||||
"mimetype": "text/x-python",
|
||||
"name": "python",
|
||||
"nbconvert_exporter": "python",
|
||||
"pygments_lexer": "ipython2",
|
||||
"version": "2.7.6"
|
||||
}
|
||||
},
|
||||
"nbformat": 4,
|
||||
"nbformat_minor": 5
|
||||
}
|
Loading…
x
Reference in New Issue
Block a user