« Image vers ASCII vers SVG » : différence entre les versions

Ligne 90 : Ligne 90 :


== 🥉 Solution 3 : img2txt + scrypt Python 3 ==
== 🥉 Solution 3 : img2txt + scrypt Python 3 ==
 
Avec couleurs Préservées
On génère une version ASCII avec couleurs :
=== On génère une version ASCII avec couleurs : ===
<syntaxhighlight lang="bash">
<syntaxhighlight lang="bash">
img2txt -W 100 -x 1 -y 2 picture.png > picture.txt
img2txt -W 100 -x 1 -y 2 picture.png > picture.txt
</syntaxhighlight>
</syntaxhighlight>


Exécution du script Python
=== Exécution du script Python ===
<syntaxhighlight lang="bash">
<syntaxhighlight lang="bash">
python3 ansi2svg_pure.py picture.txt picture.svg \
python3 ansi2svg_pure.py picture.txt picture.svg \
Ligne 107 : Ligne 107 :
</syntaxhighlight>
</syntaxhighlight>


==== Script python ====
<syntaxhighlight lang="python" line>
<syntaxhighlight lang="python" line>
#!/usr/bin/env python3
#!/usr/bin/env python3
Ligne 391 : Ligne 392 :
</syntaxhighlight>
</syntaxhighlight>


Suppresion du fond  
=== Suppresion du fond ===
<syntaxhighlight lang="bash">
<syntaxhighlight lang="bash">
sed -i '/<rect/d' picture.svg
sed -i '/<rect/d' picture.svg
</syntaxhighlight>
</syntaxhighlight>
-----


-----
-----