{"id":9353,"date":"2023-10-12T13:51:11","date_gmt":"2023-10-12T11:51:11","guid":{"rendered":"https:\/\/www.mathweb.fr\/euclide\/?p=9353"},"modified":"2023-10-12T14:08:15","modified_gmt":"2023-10-12T12:08:15","slug":"inserer-une-image-dans-un-texte-en-python","status":"publish","type":"post","link":"https:\/\/www.mathweb.fr\/euclide\/2023\/10\/12\/inserer-une-image-dans-un-texte-en-python\/","title":{"rendered":"Ins\u00e9rer une image dans un texte en Python"},"content":{"rendered":"\n<p class=\"is-style-Paragraph-paragraph\">Ins\u00e9rer une image dans un texte en Python est ce que j&#8217;ai souhait\u00e9 faire aujourd&#8217;hui. Je me suis pench\u00e9 sur la question et voici ce que j&#8217;ai fait.<\/p>\n\n\n\n<!--more-->\n\n\n\n<div id=\"ez-toc-container\" class=\"ez-toc-v2_0_82_2 counter-hierarchy ez-toc-counter ez-toc-white ez-toc-container-direction\">\n<div class=\"ez-toc-title-container\">\n<p class=\"ez-toc-title\" style=\"cursor:inherit\">Au menu sur cette page...<\/p>\n<span class=\"ez-toc-title-toggle\"><a href=\"#\" class=\"ez-toc-pull-right ez-toc-btn ez-toc-btn-xs ez-toc-btn-default ez-toc-toggle\" aria-label=\"Toggle Table of Content\"><span class=\"ez-toc-js-icon-con\"><span class=\"\"><span class=\"eztoc-hide\" style=\"display:none;\">Toggle<\/span><span class=\"ez-toc-icon-toggle-span\"><svg style=\"fill: #999;color:#999\" xmlns=\"http:\/\/www.w3.org\/2000\/svg\" class=\"list-377408\" width=\"20px\" height=\"20px\" viewBox=\"0 0 24 24\" fill=\"none\"><path d=\"M6 6H4v2h2V6zm14 0H8v2h12V6zM4 11h2v2H4v-2zm16 0H8v2h12v-2zM4 16h2v2H4v-2zm16 0H8v2h12v-2z\" fill=\"currentColor\"><\/path><\/svg><svg style=\"fill: #999;color:#999\" class=\"arrow-unsorted-368013\" xmlns=\"http:\/\/www.w3.org\/2000\/svg\" width=\"10px\" height=\"10px\" viewBox=\"0 0 24 24\" version=\"1.2\" baseProfile=\"tiny\"><path d=\"M18.2 9.3l-6.2-6.3-6.2 6.3c-.2.2-.3.4-.3.7s.1.5.3.7c.2.2.4.3.7.3h11c.3 0 .5-.1.7-.3.2-.2.3-.5.3-.7s-.1-.5-.3-.7zM5.8 14.7l6.2 6.3 6.2-6.3c.2-.2.3-.5.3-.7s-.1-.5-.3-.7c-.2-.2-.4-.3-.7-.3h-11c-.3 0-.5.1-.7.3-.2.2-.3.5-.3.7s.1.5.3.7z\"\/><\/svg><\/span><\/span><\/span><\/a><\/span><\/div>\n<nav><ul class='ez-toc-list ez-toc-list-level-1 ' ><li class='ez-toc-page-1 ez-toc-heading-level-2'><a class=\"ez-toc-link ez-toc-heading-1\" href=\"https:\/\/www.mathweb.fr\/euclide\/2023\/10\/12\/inserer-une-image-dans-un-texte-en-python\/#Inserer_une_image_dans_un_texte_en_Python_premices\" >Ins\u00e9rer une image dans un texte en Python: pr\u00e9mices<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-2'><a class=\"ez-toc-link ez-toc-heading-2\" href=\"https:\/\/www.mathweb.fr\/euclide\/2023\/10\/12\/inserer-une-image-dans-un-texte-en-python\/#Inserer_une_image_dans_un_texte_en_Python_lettres_aleatoires\" >Ins\u00e9rer une image dans un texte en Python: lettres al\u00e9atoires<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-2'><a class=\"ez-toc-link ez-toc-heading-3\" href=\"https:\/\/www.mathweb.fr\/euclide\/2023\/10\/12\/inserer-une-image-dans-un-texte-en-python\/#Inserer_une_image_dans_un_texte_en_Python_a_partir_dun_fichier_externe\" >Ins\u00e9rer une image dans un texte en Python: \u00e0 partir d&#8217;un fichier externe<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-2'><a class=\"ez-toc-link ez-toc-heading-4\" href=\"https:\/\/www.mathweb.fr\/euclide\/2023\/10\/12\/inserer-une-image-dans-un-texte-en-python\/#Un_autre_exemple_Marylin\" >Un autre exemple: Marylin<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-2'><a class=\"ez-toc-link ez-toc-heading-5\" href=\"https:\/\/www.mathweb.fr\/euclide\/2023\/10\/12\/inserer-une-image-dans-un-texte-en-python\/#Un_autre_exemple_pi_dans_pi\" >Un autre exemple: pi dans pi<\/a><\/li><\/ul><\/nav><\/div>\n<h2 class=\"wp-block-heading\"><span class=\"ez-toc-section\" id=\"Inserer_une_image_dans_un_texte_en_Python_premices\"><\/span>Ins\u00e9rer une image dans un texte en Python: pr\u00e9mices<span class=\"ez-toc-section-end\"><\/span><\/h2>\n\n\n\n<p class=\"is-style-Paragraph-paragraph\">Nous aurons besoin du module <em>PIL<\/em> ainsi que de <em>numpy<\/em>. Nous allons convertir dans un premier temps l&#8217;image suivante:<\/p>\n\n\n<div class=\"wp-block-image\">\n<figure class=\"aligncenter size-medium\"><a href=\"https:\/\/www.mathweb.fr\/euclide\/wp-content\/uploads\/2023\/10\/0000_infini2.png\" data-fancybox=\"gallery\"><img loading=\"lazy\" decoding=\"async\" width=\"300\" height=\"200\" src=\"https:\/\/www.mathweb.fr\/euclide\/wp-content\/uploads\/2023\/10\/0000_infini2-300x200.png\" alt=\"Ins\u00e9rer une image dans un texte en Python\" class=\"wp-image-9354\" srcset=\"https:\/\/www.mathweb.fr\/euclide\/wp-content\/uploads\/2023\/10\/0000_infini2-300x200.png 300w, https:\/\/www.mathweb.fr\/euclide\/wp-content\/uploads\/2023\/10\/0000_infini2-600x400.png 600w, https:\/\/www.mathweb.fr\/euclide\/wp-content\/uploads\/2023\/10\/0000_infini2.png 768w\" sizes=\"auto, (max-width: 300px) 100vw, 300px\" \/><\/a><\/figure>\n<\/div>\n\n\n<p class=\"is-style-Paragraph-paragraph\">en une matrice.<\/p>\n\n\n\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"python\" data-enlighter-theme=\"dracula\" data-enlighter-highlight=\"\" data-enlighter-linenumbers=\"false\" data-enlighter-lineoffset=\"\" data-enlighter-title=\"\" data-enlighter-group=\"\">img = Image.open(\"image.png\")\nimgArray = np.array(img)<\/pre>\n\n\n\n<pre class=\"wp-block-code\"><code>&gt;&gt;&gt; imgArray.shape\n(512, 768, 4)<\/code><\/pre>\n\n\n\n<p class=\"is-style-Paragraph-paragraph\">Avec imgArray.shape, nous avons les dimensions de l&#8217;images (le dernier nombre ne va pas nous int\u00e9resser).<\/p>\n\n\n\n<p class=\"is-style-Paragraph-paragraph\">Maintenant, on cr\u00e9\u00e9 une image vierge sur fond blanc:<\/p>\n\n\n\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"python\" data-enlighter-theme=\"dracula\" data-enlighter-highlight=\"\" data-enlighter-linenumbers=\"false\" data-enlighter-lineoffset=\"\" data-enlighter-title=\"\" data-enlighter-group=\"\">tmp = Image.new('RGB', ( imgArray.shape[1] , imgArray.shape[0] ) , 'white' )\nimage_result = ImageDraw.Draw(tmp)<\/pre>\n\n\n\n<p class=\"is-style-Paragraph-paragraph\">Dans cette nouvelle image, on va mettre une suite de &#8220;O&#8221; \u00e9crits en noir, et on va changer la couleur en rouge quand le &#8220;O&#8221; sera au niveau de ce qui \u00e9tait en noir dans l&#8217;image de d\u00e9part. <\/p>\n\n\n\n<p class=\"is-style-Paragraph-paragraph\">Pour cela, on va d&#8217;abord choisir la fonte:<\/p>\n\n\n\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"python\" data-enlighter-theme=\"dracula\" data-enlighter-highlight=\"\" data-enlighter-linenumbers=\"false\" data-enlighter-lineoffset=\"\" data-enlighter-title=\"\" data-enlighter-group=\"\">myFont = ImageFont.truetype('arial.ttf', 16)<\/pre>\n\n\n\n<p class=\"is-style-Paragraph-paragraph\">Ensuite, on va faire des boucles (comme chez le coiffeur, mais en plus fun !).<\/p>\n\n\n\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"python\" data-enlighter-theme=\"dracula\" data-enlighter-highlight=\"\" data-enlighter-linenumbers=\"false\" data-enlighter-lineoffset=\"\" data-enlighter-title=\"\" data-enlighter-group=\"\">for y in range( 0 , imgArray.shape[0] , 16):\n    for x in range( 0 , imgArray.shape[1] , 16 ):\n        r, v, b, t = imgArray[y, x] # r, v, b, t\n        if (r,v,b) == (255,255,255):\n            image_result.text((x, y), \"O\", font=myFont, fill=(0, 0, 0))\n        else:\n            image_result.text((x, y), \"O\", font=myFont, fill=(255, 0, 0))<\/pre>\n\n\n\n<p class=\"is-style-Paragraph-paragraph\">Maintenant, on affiche l&#8217;image:<\/p>\n\n\n\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"python\" data-enlighter-theme=\"dracula\" data-enlighter-highlight=\"\" data-enlighter-linenumbers=\"false\" data-enlighter-lineoffset=\"\" data-enlighter-title=\"\" data-enlighter-group=\"\">tmp.show()<\/pre>\n\n\n<div class=\"wp-block-image\">\n<figure class=\"aligncenter size-medium\"><a href=\"https:\/\/www.mathweb.fr\/euclide\/wp-content\/uploads\/2023\/10\/result.jpg\" data-fancybox=\"gallery\"><img loading=\"lazy\" decoding=\"async\" width=\"300\" height=\"200\" src=\"https:\/\/www.mathweb.fr\/euclide\/wp-content\/uploads\/2023\/10\/result-300x200.jpg\" alt=\"\" class=\"wp-image-9355\" srcset=\"https:\/\/www.mathweb.fr\/euclide\/wp-content\/uploads\/2023\/10\/result-300x200.jpg 300w, https:\/\/www.mathweb.fr\/euclide\/wp-content\/uploads\/2023\/10\/result-600x400.jpg 600w, https:\/\/www.mathweb.fr\/euclide\/wp-content\/uploads\/2023\/10\/result.jpg 768w\" sizes=\"auto, (max-width: 300px) 100vw, 300px\" \/><\/a><\/figure>\n<\/div>\n\n\n<p class=\"is-style-Paragraph-paragraph\">C&#8217;est plut\u00f4t pas mal pour un d\u00e9but, mais \u00e7a pique un peu les yeux non ?<\/p>\n\n\n\n<h2 class=\"wp-block-heading\"><span class=\"ez-toc-section\" id=\"Inserer_une_image_dans_un_texte_en_Python_lettres_aleatoires\"><\/span>Ins\u00e9rer une image dans un texte en Python: lettres al\u00e9atoires<span class=\"ez-toc-section-end\"><\/span><\/h2>\n\n\n\n<p class=\"is-style-Paragraph-paragraph\">Pour ne pas toujours mettre la m\u00eame lettre (pr\u00e9c\u00e9demment, le &#8220;O&#8221;), je vais faire appel au pseudo-hasard, et donc au module <em>random<\/em> et sa fonction <em>choice<\/em>, ainsi qu&#8217;au module <em>string<\/em> et \u00e0 sa variable <em>ascii_uppercase<\/em>.<\/p>\n\n\n\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"python\" data-enlighter-theme=\"dracula\" data-enlighter-highlight=\"\" data-enlighter-linenumbers=\"\" data-enlighter-lineoffset=\"\" data-enlighter-title=\"\" data-enlighter-group=\"\">import numpy as np\nfrom PIL import Image, ImageDraw, ImageFont\nfrom string import ascii_uppercase\nfrom random import choice\n\nimg = Image.open(\"image.png\")\nimgArray = np.array(img)\n\ntmp = Image.new('RGB', ( imgArray.shape[1] , imgArray.shape[0] ) , 'white' )\nimage_result = ImageDraw.Draw(tmp)\n\nmyFont = ImageFont.truetype('arial.ttf', 16)\n\n\nfor y in range( 0 , imgArray.shape[0] , 16):\n    for x in range( 0 , imgArray.shape[1] , 16 ):\n        r, v, b, t = imgArray[y, x] # r, v, b, t\n        if (r,v,b) == (255,255,255):\n            image_result.text((x, y), choice(ascii_uppercase), font=myFont, fill=(0, 0, 0))\n        else:\n            image_result.text((x, y), choice(ascii_uppercase), font=myFont, fill=(255, 0, 0))\n\ntmp.save('result.jpg')<\/pre>\n\n\n<div class=\"wp-block-image\">\n<figure class=\"aligncenter size-medium\"><a href=\"https:\/\/www.mathweb.fr\/euclide\/wp-content\/uploads\/2023\/10\/result-1.jpg\" data-fancybox=\"gallery\"><img loading=\"lazy\" decoding=\"async\" width=\"300\" height=\"200\" src=\"https:\/\/www.mathweb.fr\/euclide\/wp-content\/uploads\/2023\/10\/result-1-300x200.jpg\" alt=\"Ins\u00e9rer une image dans un texte en Python\" class=\"wp-image-9356\" srcset=\"https:\/\/www.mathweb.fr\/euclide\/wp-content\/uploads\/2023\/10\/result-1-300x200.jpg 300w, https:\/\/www.mathweb.fr\/euclide\/wp-content\/uploads\/2023\/10\/result-1-600x400.jpg 600w, https:\/\/www.mathweb.fr\/euclide\/wp-content\/uploads\/2023\/10\/result-1.jpg 768w\" sizes=\"auto, (max-width: 300px) 100vw, 300px\" \/><\/a><\/figure>\n<\/div>\n\n\n<p class=\"is-style-Paragraph-paragraph\">Bon, l\u00e0, vous allez me dire : &#8220;C&#8217;est bien gentil Coco, mais le texte ne veut rien dire&#8221;. Ok ! Alors prenons un texte contenu dans un fichier externe&#8230;<\/p>\n\n\n\n<h2 class=\"wp-block-heading\"><span class=\"ez-toc-section\" id=\"Inserer_une_image_dans_un_texte_en_Python_a_partir_dun_fichier_externe\"><\/span>Ins\u00e9rer une image dans un texte en Python: \u00e0 partir d&#8217;un fichier externe<span class=\"ez-toc-section-end\"><\/span><\/h2>\n\n\n\n<p>Voici une premi\u00e8re proposition:<\/p>\n\n\n\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"python\" data-enlighter-theme=\"dracula\" data-enlighter-highlight=\"\" data-enlighter-linenumbers=\"\" data-enlighter-lineoffset=\"\" data-enlighter-title=\"\" data-enlighter-group=\"\">import numpy as np\nfrom PIL import Image, ImageDraw, ImageFont\n\nimg = Image.open(\"image.png\")\nimgArray = np.array(img)\n\ntmp = Image.new('RGB', ( imgArray.shape[1] , imgArray.shape[0] ) , 'white' )\nimage_result = ImageDraw.Draw(tmp)\n\nmyFont = ImageFont.truetype('arial.ttf', 16)\n\nlorem = open(\"lorem-ipsum.txt\", \"r\" , encoding='utf8').read()\nc = 0 # compteur de position de la lettre dans lorem\n\nfor y in range( 0 , imgArray.shape[0] , 16):\n    for x in range( 0 , imgArray.shape[1] , 16 ):\n        r, v, b, t = imgArray[y, x] # r, v, b, t\n        if (r,v,b) == (255,255,255):\n            image_result.text((x, y), lorem[c], font=myFont, fill=(0, 0, 0))\n        else:\n            image_result.text((x, y), lorem[c], font=myFont, fill=(255, 0, 0))\n        c += 1\n\ntmp.save('result.jpg')<\/pre>\n\n\n<div class=\"wp-block-image\">\n<figure class=\"aligncenter size-medium\"><a href=\"https:\/\/www.mathweb.fr\/euclide\/wp-content\/uploads\/2023\/10\/result-2.jpg\" data-fancybox=\"gallery\"><img loading=\"lazy\" decoding=\"async\" width=\"300\" height=\"200\" src=\"https:\/\/www.mathweb.fr\/euclide\/wp-content\/uploads\/2023\/10\/result-2-300x200.jpg\" alt=\"Ins\u00e9rer une image dans un texte en Python: \u00e0 partir d'un fichier externe\" class=\"wp-image-9357\" srcset=\"https:\/\/www.mathweb.fr\/euclide\/wp-content\/uploads\/2023\/10\/result-2-300x200.jpg 300w, https:\/\/www.mathweb.fr\/euclide\/wp-content\/uploads\/2023\/10\/result-2-600x400.jpg 600w, https:\/\/www.mathweb.fr\/euclide\/wp-content\/uploads\/2023\/10\/result-2.jpg 768w\" sizes=\"auto, (max-width: 300px) 100vw, 300px\" \/><\/a><\/figure>\n<\/div>\n\n\n<p class=\"is-style-Paragraph-paragraph\">On se rapproche d&#8217;un r\u00e9sultat plut\u00f4t satisfaisant. Cependant, l&#8217;espace entre les lettres est trop important lorsque ce sont des minuscules&#8230; Il faut absolument y rem\u00e9dier.<\/p>\n\n\n\n<p class=\"is-style-Paragraph-paragraph\">Pour cela, je prends le parti prix de mettre toutes les lettres en majuscules et de diminuer les espaces, que j&#8217;avais fix\u00e9es \u00e0 16 pixels pr\u00e9c\u00e9demment.<\/p>\n\n\n\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"python\" data-enlighter-theme=\"dracula\" data-enlighter-highlight=\"\" data-enlighter-linenumbers=\"\" data-enlighter-lineoffset=\"\" data-enlighter-title=\"\" data-enlighter-group=\"\">import numpy as np\nfrom PIL import Image, ImageDraw, ImageFont\nfrom string import ascii_lowercase, ascii_uppercase\n\nimg = Image.open(\"image.png\")\nimgArray = np.array(img)\n\ntmp = Image.new('RGB', ( imgArray.shape[1] , imgArray.shape[0] ) , 'white' )\nimage_result = ImageDraw.Draw(tmp)\n\nmyFont = ImageFont.truetype('arial.ttf', 12)\n\nlorem = open(\"lorem-ipsum.txt\", \"r\" , encoding='utf8').read()\nc = 0 # compteur de position de la lettre dans lorem\n\nfor y in range( 0 , imgArray.shape[0] , 12):\n    for x in range( 0 , imgArray.shape[1] , 12 ):\n        r, v, b, t = imgArray[y, x] # r, v, b, t       \n        if (r,v,b) == (255,255,255):\n            image_result.text((x, y), lorem[c].upper(), font=myFont, fill=(0, 0, 0))\n        else:\n            image_result.text((x, y), lorem[c].upper(), font=myFont, fill=(255, 0, 0))\n        c += 1\n\ntmp.save('result.jpg')<\/pre>\n\n\n<div class=\"wp-block-image\">\n<figure class=\"aligncenter size-medium\"><a href=\"https:\/\/www.mathweb.fr\/euclide\/wp-content\/uploads\/2023\/10\/result-3.jpg\" data-fancybox=\"gallery\"><img loading=\"lazy\" decoding=\"async\" width=\"300\" height=\"200\" src=\"https:\/\/www.mathweb.fr\/euclide\/wp-content\/uploads\/2023\/10\/result-3-300x200.jpg\" alt=\"\" class=\"wp-image-9358\" srcset=\"https:\/\/www.mathweb.fr\/euclide\/wp-content\/uploads\/2023\/10\/result-3-300x200.jpg 300w, https:\/\/www.mathweb.fr\/euclide\/wp-content\/uploads\/2023\/10\/result-3-600x400.jpg 600w, https:\/\/www.mathweb.fr\/euclide\/wp-content\/uploads\/2023\/10\/result-3.jpg 768w\" sizes=\"auto, (max-width: 300px) 100vw, 300px\" \/><\/a><\/figure>\n<\/div>\n\n\n<h2 class=\"wp-block-heading\"><span class=\"ez-toc-section\" id=\"Un_autre_exemple_Marylin\"><\/span>Un autre exemple: Marylin<span class=\"ez-toc-section-end\"><\/span><\/h2>\n\n\n\n<p class=\"is-style-Paragraph-paragraph\">Partons de l&#8217;image suivante:<\/p>\n\n\n<div class=\"wp-block-image\">\n<figure class=\"aligncenter size-medium\"><a href=\"https:\/\/www.mathweb.fr\/euclide\/wp-content\/uploads\/2023\/10\/marylin.png\" data-fancybox=\"gallery\"><img loading=\"lazy\" decoding=\"async\" width=\"225\" height=\"300\" src=\"https:\/\/www.mathweb.fr\/euclide\/wp-content\/uploads\/2023\/10\/marylin-225x300.png\" alt=\"marylin monroe portrait\" class=\"wp-image-9359\" srcset=\"https:\/\/www.mathweb.fr\/euclide\/wp-content\/uploads\/2023\/10\/marylin-225x300.png 225w, https:\/\/www.mathweb.fr\/euclide\/wp-content\/uploads\/2023\/10\/marylin.png 600w\" sizes=\"auto, (max-width: 225px) 100vw, 225px\" \/><\/a><\/figure>\n<\/div>\n\n\n<p>Et utilisons le script suivant:<\/p>\n\n\n\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"python\" data-enlighter-theme=\"dracula\" data-enlighter-highlight=\"\" data-enlighter-linenumbers=\"\" data-enlighter-lineoffset=\"\" data-enlighter-title=\"\" data-enlighter-group=\"\">import numpy as np\nfrom PIL import Image, ImageDraw, ImageFont\nfrom string import ascii_lowercase, ascii_uppercase\n\nimg = Image.open(\"marylin.png\")\nimgArray = np.array(img)\n\ntmp = Image.new('RGB', ( imgArray.shape[1] , imgArray.shape[0] ) , 'white' )\nimage_result = ImageDraw.Draw(tmp)\n\nmyFont = ImageFont.truetype('arial.ttf', 12)\n\nlorem = open(\"lorem-ipsum.txt\", \"r\" , encoding='utf8').read()\nc = 0 # compteur de position de la lettre dans lorem\n\nfor y in range( 0 , imgArray.shape[0] , 12):\n    for x in range( 0 , imgArray.shape[1] , 12 ):\n        b,w = imgArray[y, x] # r, v, b, t       \n        if (b,w) == (255,255):\n            image_result.text((x, y), lorem[c].upper(), font=myFont, fill=(200, 200, 200))\n        else:\n            image_result.text((x, y), lorem[c].upper(), font=myFont, fill=(0, 0, 0))\n        c += 1\n\ntmp.save('result.jpg')<\/pre>\n\n\n<div class=\"wp-block-image\">\n<figure class=\"aligncenter size-medium\"><a href=\"https:\/\/www.mathweb.fr\/euclide\/wp-content\/uploads\/2023\/10\/result-4.jpg\" data-fancybox=\"gallery\"><img loading=\"lazy\" decoding=\"async\" width=\"225\" height=\"300\" src=\"https:\/\/www.mathweb.fr\/euclide\/wp-content\/uploads\/2023\/10\/result-4-225x300.jpg\" alt=\"\" class=\"wp-image-9360\" srcset=\"https:\/\/www.mathweb.fr\/euclide\/wp-content\/uploads\/2023\/10\/result-4-225x300.jpg 225w, https:\/\/www.mathweb.fr\/euclide\/wp-content\/uploads\/2023\/10\/result-4.jpg 600w\" sizes=\"auto, (max-width: 225px) 100vw, 225px\" \/><\/a><\/figure>\n<\/div>\n\n\n<p><\/p>\n\n\n\n<h2 class=\"wp-block-heading\"><span class=\"ez-toc-section\" id=\"Un_autre_exemple_pi_dans_pi\"><\/span>Un autre exemple: pi dans pi<span class=\"ez-toc-section-end\"><\/span><\/h2>\n\n\n\n<p>On part de l&#8217;image:<\/p>\n\n\n<div class=\"wp-block-image\">\n<figure class=\"aligncenter size-medium\"><a href=\"https:\/\/www.mathweb.fr\/euclide\/wp-content\/uploads\/2023\/10\/pi.jpg\" data-fancybox=\"gallery\"><img loading=\"lazy\" decoding=\"async\" width=\"300\" height=\"169\" src=\"https:\/\/www.mathweb.fr\/euclide\/wp-content\/uploads\/2023\/10\/pi-300x169.jpg\" alt=\"pi\" class=\"wp-image-9363\" srcset=\"https:\/\/www.mathweb.fr\/euclide\/wp-content\/uploads\/2023\/10\/pi-300x169.jpg 300w, https:\/\/www.mathweb.fr\/euclide\/wp-content\/uploads\/2023\/10\/pi-600x338.jpg 600w, https:\/\/www.mathweb.fr\/euclide\/wp-content\/uploads\/2023\/10\/pi-1024x576.jpg 1024w, https:\/\/www.mathweb.fr\/euclide\/wp-content\/uploads\/2023\/10\/pi-768x432.jpg 768w, https:\/\/www.mathweb.fr\/euclide\/wp-content\/uploads\/2023\/10\/pi-1536x864.jpg 1536w, https:\/\/www.mathweb.fr\/euclide\/wp-content\/uploads\/2023\/10\/pi-800x450.jpg 800w, https:\/\/www.mathweb.fr\/euclide\/wp-content\/uploads\/2023\/10\/pi.jpg 1920w\" sizes=\"auto, (max-width: 300px) 100vw, 300px\" \/><\/a><\/figure>\n<\/div>\n\n\n<p>et on utilise un fichier texte contenant plein de d\u00e9cimales de pi:<\/p>\n\n\n\n<div class=\"wp-block-file aligncenter\"><a id=\"wp-block-file--media-13913791-9a83-40ac-b08c-b89de9f190cf\" href=\"https:\/\/www.mathweb.fr\/euclide\/wp-content\/uploads\/2023\/10\/pi.txt\">pi<\/a><a href=\"https:\/\/www.mathweb.fr\/euclide\/wp-content\/uploads\/2023\/10\/pi.txt\" class=\"wp-block-file__button wp-element-button\" download aria-describedby=\"wp-block-file--media-13913791-9a83-40ac-b08c-b89de9f190cf\">T\u00e9l\u00e9charger<\/a><\/div>\n\n\n\n<p class=\"is-style-Paragraph-paragraph\">On utilise enfin le programme suivant:<\/p>\n\n\n\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"python\" data-enlighter-theme=\"dracula\" data-enlighter-highlight=\"\" data-enlighter-linenumbers=\"\" data-enlighter-lineoffset=\"\" data-enlighter-title=\"\" data-enlighter-group=\"\">import numpy as np\nfrom PIL import Image, ImageDraw, ImageFont\nfrom string import ascii_lowercase, ascii_uppercase\n\nimg = Image.open(\"pi.jpg\")\nimgArray = np.array(img)\n\ntmp = Image.new('RGB', ( imgArray.shape[1] , imgArray.shape[0] ) , 'white' )\nimage_result = ImageDraw.Draw(tmp)\n\nmyFont = ImageFont.truetype('arial.ttf', 12)\n\npi = open(\"pi.txt\", \"r\" , encoding='utf8').read().replace('\\n','')\nc = 0 # compteur de position de la lettre dans lorem\n\nfor y in range( 0 , imgArray.shape[0] , 12):\n    for x in range( 0 , imgArray.shape[1] , 12 ):\n        r, v,b = imgArray[y, x] # r, v, b, t\n        if (r,v,b) == (255,255,255):\n            image_result.text((x, y), pi[c].upper(), font=myFont, fill=(200, 200, 200))\n        else:\n            image_result.text((x, y), pi[c].upper(), font=myFont, fill=(255, 0, 0))\n        c += 1\n\ntmp.save('result-pi.jpg')<\/pre>\n\n\n\n<p>On obtient alors:<\/p>\n\n\n<div class=\"wp-block-image\">\n<figure class=\"aligncenter size-medium\"><a href=\"https:\/\/www.mathweb.fr\/euclide\/wp-content\/uploads\/2023\/10\/result-pi.jpg\" data-fancybox=\"gallery\"><img loading=\"lazy\" decoding=\"async\" width=\"300\" height=\"169\" src=\"https:\/\/www.mathweb.fr\/euclide\/wp-content\/uploads\/2023\/10\/result-pi-300x169.jpg\" alt=\"\" class=\"wp-image-9366\" srcset=\"https:\/\/www.mathweb.fr\/euclide\/wp-content\/uploads\/2023\/10\/result-pi-300x169.jpg 300w, https:\/\/www.mathweb.fr\/euclide\/wp-content\/uploads\/2023\/10\/result-pi-600x338.jpg 600w, https:\/\/www.mathweb.fr\/euclide\/wp-content\/uploads\/2023\/10\/result-pi-1024x576.jpg 1024w, https:\/\/www.mathweb.fr\/euclide\/wp-content\/uploads\/2023\/10\/result-pi-768x432.jpg 768w, https:\/\/www.mathweb.fr\/euclide\/wp-content\/uploads\/2023\/10\/result-pi-1536x864.jpg 1536w, https:\/\/www.mathweb.fr\/euclide\/wp-content\/uploads\/2023\/10\/result-pi-800x450.jpg 800w, https:\/\/www.mathweb.fr\/euclide\/wp-content\/uploads\/2023\/10\/result-pi.jpg 1920w\" sizes=\"auto, (max-width: 300px) 100vw, 300px\" \/><\/a><\/figure>\n<\/div>","protected":false},"excerpt":{"rendered":"<p>Ins\u00e9rer une image dans un texte en Python est ce que j&#8217;ai souhait\u00e9 faire aujourd&#8217;hui. Je me suis pench\u00e9 sur la question et voici ce que j&#8217;ai fait.<\/p>\n","protected":false},"author":1,"featured_media":9361,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[5],"tags":[],"class_list":["post-9353","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-python"],"yoast_head":"<!-- This site is optimized with the Yoast SEO plugin v27.5 - https:\/\/yoast.com\/product\/yoast-seo-wordpress\/ -->\n<title>Ins\u00e9rer une image dans un texte en Python - Mathweb.fr<\/title>\n<meta name=\"description\" content=\"Ins\u00e9rer une image dans un texte en Python est ce que j&#039;ai souhait\u00e9 faire aujourd&#039;hui. Je me suis pench\u00e9 sur la question.\" \/>\n<meta name=\"robots\" content=\"index, follow, max-snippet:-1, max-image-preview:large, max-video-preview:-1\" \/>\n<link rel=\"canonical\" href=\"https:\/\/www.mathweb.fr\/euclide\/2023\/10\/12\/inserer-une-image-dans-un-texte-en-python\/\" \/>\n<meta property=\"og:locale\" content=\"fr_FR\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"Ins\u00e9rer une image dans un texte en Python - Mathweb.fr\" \/>\n<meta property=\"og:description\" content=\"Ins\u00e9rer une image dans un texte en Python est ce que j&#039;ai souhait\u00e9 faire aujourd&#039;hui. Je me suis pench\u00e9 sur la question.\" \/>\n<meta property=\"og:url\" content=\"https:\/\/www.mathweb.fr\/euclide\/2023\/10\/12\/inserer-une-image-dans-un-texte-en-python\/\" \/>\n<meta property=\"og:site_name\" content=\"Mathweb.fr\" \/>\n<meta property=\"article:published_time\" content=\"2023-10-12T11:51:11+00:00\" \/>\n<meta property=\"article:modified_time\" content=\"2023-10-12T12:08:15+00:00\" \/>\n<meta property=\"og:image\" content=\"https:\/\/www.mathweb.fr\/euclide\/wp-content\/uploads\/2023\/10\/head-articles-python-inserer-image-texte.jpg\" \/>\n\t<meta property=\"og:image:width\" content=\"740\" \/>\n\t<meta property=\"og:image:height\" content=\"198\" \/>\n\t<meta property=\"og:image:type\" content=\"image\/jpeg\" \/>\n<meta name=\"author\" content=\"St\u00e9phane Pasquet\" \/>\n<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\n<meta name=\"twitter:label1\" content=\"\u00c9crit par\" \/>\n\t<meta name=\"twitter:data1\" content=\"St\u00e9phane Pasquet\" \/>\n\t<meta name=\"twitter:label2\" content=\"Dur\u00e9e de lecture estim\u00e9e\" \/>\n\t<meta name=\"twitter:data2\" content=\"4 minutes\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\\\/\\\/schema.org\",\"@graph\":[{\"@type\":\"Article\",\"@id\":\"https:\\\/\\\/www.mathweb.fr\\\/euclide\\\/2023\\\/10\\\/12\\\/inserer-une-image-dans-un-texte-en-python\\\/#article\",\"isPartOf\":{\"@id\":\"https:\\\/\\\/www.mathweb.fr\\\/euclide\\\/2023\\\/10\\\/12\\\/inserer-une-image-dans-un-texte-en-python\\\/\"},\"author\":{\"name\":\"St\u00e9phane Pasquet\",\"@id\":\"https:\\\/\\\/www.mathweb.fr\\\/euclide\\\/#\\\/schema\\\/person\\\/e4d3bb07968238378f0d5052a70dcd69\"},\"headline\":\"Ins\u00e9rer une image dans un texte en Python\",\"datePublished\":\"2023-10-12T11:51:11+00:00\",\"dateModified\":\"2023-10-12T12:08:15+00:00\",\"mainEntityOfPage\":{\"@id\":\"https:\\\/\\\/www.mathweb.fr\\\/euclide\\\/2023\\\/10\\\/12\\\/inserer-une-image-dans-un-texte-en-python\\\/\"},\"wordCount\":396,\"commentCount\":2,\"publisher\":{\"@id\":\"https:\\\/\\\/www.mathweb.fr\\\/euclide\\\/#\\\/schema\\\/person\\\/e4d3bb07968238378f0d5052a70dcd69\"},\"image\":{\"@id\":\"https:\\\/\\\/www.mathweb.fr\\\/euclide\\\/2023\\\/10\\\/12\\\/inserer-une-image-dans-un-texte-en-python\\\/#primaryimage\"},\"thumbnailUrl\":\"https:\\\/\\\/www.mathweb.fr\\\/euclide\\\/wp-content\\\/uploads\\\/2023\\\/10\\\/head-articles-python-inserer-image-texte.jpg\",\"articleSection\":[\"Python\"],\"inLanguage\":\"fr-FR\",\"potentialAction\":[{\"@type\":\"CommentAction\",\"name\":\"Comment\",\"target\":[\"https:\\\/\\\/www.mathweb.fr\\\/euclide\\\/2023\\\/10\\\/12\\\/inserer-une-image-dans-un-texte-en-python\\\/#respond\"]}]},{\"@type\":\"WebPage\",\"@id\":\"https:\\\/\\\/www.mathweb.fr\\\/euclide\\\/2023\\\/10\\\/12\\\/inserer-une-image-dans-un-texte-en-python\\\/\",\"url\":\"https:\\\/\\\/www.mathweb.fr\\\/euclide\\\/2023\\\/10\\\/12\\\/inserer-une-image-dans-un-texte-en-python\\\/\",\"name\":\"Ins\u00e9rer une image dans un texte en Python - Mathweb.fr\",\"isPartOf\":{\"@id\":\"https:\\\/\\\/www.mathweb.fr\\\/euclide\\\/#website\"},\"primaryImageOfPage\":{\"@id\":\"https:\\\/\\\/www.mathweb.fr\\\/euclide\\\/2023\\\/10\\\/12\\\/inserer-une-image-dans-un-texte-en-python\\\/#primaryimage\"},\"image\":{\"@id\":\"https:\\\/\\\/www.mathweb.fr\\\/euclide\\\/2023\\\/10\\\/12\\\/inserer-une-image-dans-un-texte-en-python\\\/#primaryimage\"},\"thumbnailUrl\":\"https:\\\/\\\/www.mathweb.fr\\\/euclide\\\/wp-content\\\/uploads\\\/2023\\\/10\\\/head-articles-python-inserer-image-texte.jpg\",\"datePublished\":\"2023-10-12T11:51:11+00:00\",\"dateModified\":\"2023-10-12T12:08:15+00:00\",\"description\":\"Ins\u00e9rer une image dans un texte en Python est ce que j'ai souhait\u00e9 faire aujourd'hui. Je me suis pench\u00e9 sur la question.\",\"breadcrumb\":{\"@id\":\"https:\\\/\\\/www.mathweb.fr\\\/euclide\\\/2023\\\/10\\\/12\\\/inserer-une-image-dans-un-texte-en-python\\\/#breadcrumb\"},\"inLanguage\":\"fr-FR\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\\\/\\\/www.mathweb.fr\\\/euclide\\\/2023\\\/10\\\/12\\\/inserer-une-image-dans-un-texte-en-python\\\/\"]}]},{\"@type\":\"ImageObject\",\"inLanguage\":\"fr-FR\",\"@id\":\"https:\\\/\\\/www.mathweb.fr\\\/euclide\\\/2023\\\/10\\\/12\\\/inserer-une-image-dans-un-texte-en-python\\\/#primaryimage\",\"url\":\"https:\\\/\\\/www.mathweb.fr\\\/euclide\\\/wp-content\\\/uploads\\\/2023\\\/10\\\/head-articles-python-inserer-image-texte.jpg\",\"contentUrl\":\"https:\\\/\\\/www.mathweb.fr\\\/euclide\\\/wp-content\\\/uploads\\\/2023\\\/10\\\/head-articles-python-inserer-image-texte.jpg\",\"width\":740,\"height\":198,\"caption\":\"ins\u00e9rer image dans texte\"},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\\\/\\\/www.mathweb.fr\\\/euclide\\\/2023\\\/10\\\/12\\\/inserer-une-image-dans-un-texte-en-python\\\/#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"Accueil\",\"item\":\"https:\\\/\\\/www.mathweb.fr\\\/euclide\\\/\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"Ins\u00e9rer une image dans un texte en Python\"}]},{\"@type\":\"WebSite\",\"@id\":\"https:\\\/\\\/www.mathweb.fr\\\/euclide\\\/#website\",\"url\":\"https:\\\/\\\/www.mathweb.fr\\\/euclide\\\/\",\"name\":\"Mathweb.fr\",\"description\":\"Math\u00e9matiques, LaTeX et Python\",\"publisher\":{\"@id\":\"https:\\\/\\\/www.mathweb.fr\\\/euclide\\\/#\\\/schema\\\/person\\\/e4d3bb07968238378f0d5052a70dcd69\"},\"potentialAction\":[{\"@type\":\"SearchAction\",\"target\":{\"@type\":\"EntryPoint\",\"urlTemplate\":\"https:\\\/\\\/www.mathweb.fr\\\/euclide\\\/?s={search_term_string}\"},\"query-input\":{\"@type\":\"PropertyValueSpecification\",\"valueRequired\":true,\"valueName\":\"search_term_string\"}}],\"inLanguage\":\"fr-FR\"},{\"@type\":[\"Person\",\"Organization\"],\"@id\":\"https:\\\/\\\/www.mathweb.fr\\\/euclide\\\/#\\\/schema\\\/person\\\/e4d3bb07968238378f0d5052a70dcd69\",\"name\":\"St\u00e9phane Pasquet\",\"image\":{\"@type\":\"ImageObject\",\"inLanguage\":\"fr-FR\",\"@id\":\"https:\\\/\\\/www.mathweb.fr\\\/euclide\\\/wp-content\\\/uploads\\\/2025\\\/06\\\/cropped-logo-mathweb.webp\",\"url\":\"https:\\\/\\\/www.mathweb.fr\\\/euclide\\\/wp-content\\\/uploads\\\/2025\\\/06\\\/cropped-logo-mathweb.webp\",\"contentUrl\":\"https:\\\/\\\/www.mathweb.fr\\\/euclide\\\/wp-content\\\/uploads\\\/2025\\\/06\\\/cropped-logo-mathweb.webp\",\"width\":74,\"height\":77,\"caption\":\"St\u00e9phane Pasquet\"},\"logo\":{\"@id\":\"https:\\\/\\\/www.mathweb.fr\\\/euclide\\\/wp-content\\\/uploads\\\/2025\\\/06\\\/cropped-logo-mathweb.webp\"}}]}<\/script>\n<!-- \/ Yoast SEO plugin. -->","yoast_head_json":{"title":"Ins\u00e9rer une image dans un texte en Python - Mathweb.fr","description":"Ins\u00e9rer une image dans un texte en Python est ce que j'ai souhait\u00e9 faire aujourd'hui. Je me suis pench\u00e9 sur la question.","robots":{"index":"index","follow":"follow","max-snippet":"max-snippet:-1","max-image-preview":"max-image-preview:large","max-video-preview":"max-video-preview:-1"},"canonical":"https:\/\/www.mathweb.fr\/euclide\/2023\/10\/12\/inserer-une-image-dans-un-texte-en-python\/","og_locale":"fr_FR","og_type":"article","og_title":"Ins\u00e9rer une image dans un texte en Python - Mathweb.fr","og_description":"Ins\u00e9rer une image dans un texte en Python est ce que j'ai souhait\u00e9 faire aujourd'hui. Je me suis pench\u00e9 sur la question.","og_url":"https:\/\/www.mathweb.fr\/euclide\/2023\/10\/12\/inserer-une-image-dans-un-texte-en-python\/","og_site_name":"Mathweb.fr","article_published_time":"2023-10-12T11:51:11+00:00","article_modified_time":"2023-10-12T12:08:15+00:00","og_image":[{"width":740,"height":198,"url":"https:\/\/www.mathweb.fr\/euclide\/wp-content\/uploads\/2023\/10\/head-articles-python-inserer-image-texte.jpg","type":"image\/jpeg"}],"author":"St\u00e9phane Pasquet","twitter_card":"summary_large_image","twitter_misc":{"\u00c9crit par":"St\u00e9phane Pasquet","Dur\u00e9e de lecture estim\u00e9e":"4 minutes"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"Article","@id":"https:\/\/www.mathweb.fr\/euclide\/2023\/10\/12\/inserer-une-image-dans-un-texte-en-python\/#article","isPartOf":{"@id":"https:\/\/www.mathweb.fr\/euclide\/2023\/10\/12\/inserer-une-image-dans-un-texte-en-python\/"},"author":{"name":"St\u00e9phane Pasquet","@id":"https:\/\/www.mathweb.fr\/euclide\/#\/schema\/person\/e4d3bb07968238378f0d5052a70dcd69"},"headline":"Ins\u00e9rer une image dans un texte en Python","datePublished":"2023-10-12T11:51:11+00:00","dateModified":"2023-10-12T12:08:15+00:00","mainEntityOfPage":{"@id":"https:\/\/www.mathweb.fr\/euclide\/2023\/10\/12\/inserer-une-image-dans-un-texte-en-python\/"},"wordCount":396,"commentCount":2,"publisher":{"@id":"https:\/\/www.mathweb.fr\/euclide\/#\/schema\/person\/e4d3bb07968238378f0d5052a70dcd69"},"image":{"@id":"https:\/\/www.mathweb.fr\/euclide\/2023\/10\/12\/inserer-une-image-dans-un-texte-en-python\/#primaryimage"},"thumbnailUrl":"https:\/\/www.mathweb.fr\/euclide\/wp-content\/uploads\/2023\/10\/head-articles-python-inserer-image-texte.jpg","articleSection":["Python"],"inLanguage":"fr-FR","potentialAction":[{"@type":"CommentAction","name":"Comment","target":["https:\/\/www.mathweb.fr\/euclide\/2023\/10\/12\/inserer-une-image-dans-un-texte-en-python\/#respond"]}]},{"@type":"WebPage","@id":"https:\/\/www.mathweb.fr\/euclide\/2023\/10\/12\/inserer-une-image-dans-un-texte-en-python\/","url":"https:\/\/www.mathweb.fr\/euclide\/2023\/10\/12\/inserer-une-image-dans-un-texte-en-python\/","name":"Ins\u00e9rer une image dans un texte en Python - Mathweb.fr","isPartOf":{"@id":"https:\/\/www.mathweb.fr\/euclide\/#website"},"primaryImageOfPage":{"@id":"https:\/\/www.mathweb.fr\/euclide\/2023\/10\/12\/inserer-une-image-dans-un-texte-en-python\/#primaryimage"},"image":{"@id":"https:\/\/www.mathweb.fr\/euclide\/2023\/10\/12\/inserer-une-image-dans-un-texte-en-python\/#primaryimage"},"thumbnailUrl":"https:\/\/www.mathweb.fr\/euclide\/wp-content\/uploads\/2023\/10\/head-articles-python-inserer-image-texte.jpg","datePublished":"2023-10-12T11:51:11+00:00","dateModified":"2023-10-12T12:08:15+00:00","description":"Ins\u00e9rer une image dans un texte en Python est ce que j'ai souhait\u00e9 faire aujourd'hui. Je me suis pench\u00e9 sur la question.","breadcrumb":{"@id":"https:\/\/www.mathweb.fr\/euclide\/2023\/10\/12\/inserer-une-image-dans-un-texte-en-python\/#breadcrumb"},"inLanguage":"fr-FR","potentialAction":[{"@type":"ReadAction","target":["https:\/\/www.mathweb.fr\/euclide\/2023\/10\/12\/inserer-une-image-dans-un-texte-en-python\/"]}]},{"@type":"ImageObject","inLanguage":"fr-FR","@id":"https:\/\/www.mathweb.fr\/euclide\/2023\/10\/12\/inserer-une-image-dans-un-texte-en-python\/#primaryimage","url":"https:\/\/www.mathweb.fr\/euclide\/wp-content\/uploads\/2023\/10\/head-articles-python-inserer-image-texte.jpg","contentUrl":"https:\/\/www.mathweb.fr\/euclide\/wp-content\/uploads\/2023\/10\/head-articles-python-inserer-image-texte.jpg","width":740,"height":198,"caption":"ins\u00e9rer image dans texte"},{"@type":"BreadcrumbList","@id":"https:\/\/www.mathweb.fr\/euclide\/2023\/10\/12\/inserer-une-image-dans-un-texte-en-python\/#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"Accueil","item":"https:\/\/www.mathweb.fr\/euclide\/"},{"@type":"ListItem","position":2,"name":"Ins\u00e9rer une image dans un texte en Python"}]},{"@type":"WebSite","@id":"https:\/\/www.mathweb.fr\/euclide\/#website","url":"https:\/\/www.mathweb.fr\/euclide\/","name":"Mathweb.fr","description":"Math\u00e9matiques, LaTeX et Python","publisher":{"@id":"https:\/\/www.mathweb.fr\/euclide\/#\/schema\/person\/e4d3bb07968238378f0d5052a70dcd69"},"potentialAction":[{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https:\/\/www.mathweb.fr\/euclide\/?s={search_term_string}"},"query-input":{"@type":"PropertyValueSpecification","valueRequired":true,"valueName":"search_term_string"}}],"inLanguage":"fr-FR"},{"@type":["Person","Organization"],"@id":"https:\/\/www.mathweb.fr\/euclide\/#\/schema\/person\/e4d3bb07968238378f0d5052a70dcd69","name":"St\u00e9phane Pasquet","image":{"@type":"ImageObject","inLanguage":"fr-FR","@id":"https:\/\/www.mathweb.fr\/euclide\/wp-content\/uploads\/2025\/06\/cropped-logo-mathweb.webp","url":"https:\/\/www.mathweb.fr\/euclide\/wp-content\/uploads\/2025\/06\/cropped-logo-mathweb.webp","contentUrl":"https:\/\/www.mathweb.fr\/euclide\/wp-content\/uploads\/2025\/06\/cropped-logo-mathweb.webp","width":74,"height":77,"caption":"St\u00e9phane Pasquet"},"logo":{"@id":"https:\/\/www.mathweb.fr\/euclide\/wp-content\/uploads\/2025\/06\/cropped-logo-mathweb.webp"}}]}},"_links":{"self":[{"href":"https:\/\/www.mathweb.fr\/euclide\/wp-json\/wp\/v2\/posts\/9353","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.mathweb.fr\/euclide\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.mathweb.fr\/euclide\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.mathweb.fr\/euclide\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/www.mathweb.fr\/euclide\/wp-json\/wp\/v2\/comments?post=9353"}],"version-history":[{"count":0,"href":"https:\/\/www.mathweb.fr\/euclide\/wp-json\/wp\/v2\/posts\/9353\/revisions"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/www.mathweb.fr\/euclide\/wp-json\/wp\/v2\/media\/9361"}],"wp:attachment":[{"href":"https:\/\/www.mathweb.fr\/euclide\/wp-json\/wp\/v2\/media?parent=9353"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.mathweb.fr\/euclide\/wp-json\/wp\/v2\/categories?post=9353"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.mathweb.fr\/euclide\/wp-json\/wp\/v2\/tags?post=9353"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}