# Owner: glow
# KeyID: E65A8520F36AEE13CFE4F56BEB8FE331063A4794
# Key: https://glow.li/pgp
# Verify: curl "https://glow.li/posts/pkmn/index.html.asc" | gpg
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA512
+++
{
"css": ["iframe.css"],
"date": "2023-05-25",
"description": "I converted all Pokémon sprites to ANSI, so you can view them in you terminal (or browser)",
"layout": "post",
"sharingimage": "media/images/pkmn-preview",
"tags": [
"Technology",
"Showcase",
"Terminal",
"Web_Development",
"Project",
"CLI"
],
"title": "pkmn.li: Pokémon sprites in your terminal"
}
+++
I converted all Pokémon sprites to ANSI, so you can view them in you terminal (or browser).
Get a random Pokémon in your terminal:
```
curl = pkmnUrl() ?>
```
Get a specific Pokémon:
```
curl = pkmnUrl(false,"25/"); ?>
```
You can also view it in the browser: [= pkmnUrl() ?>](= pkmnUrl(true) ?>)
You will need [true color support](https://github.com/termstandard/colors#fully-supporting) in your terminal.
## Data
I am using the [PokeAPI sprites](https://github.com/PokeAPI/sprites) for the images and the [PokeAPI api-data](https://github.com/PokeAPI/api-data) for the flavor text (Pokédex entries). I am generating all Pokémon from the static data in the repositories. I am not actually using the PokeAPI.
## Creating ANSI from the sprites
To create the ANSI from the sprites I am using the Rust program [viu](https://github.com/atanunq/viu).
Generating html from ANSI is actually rather difficult. Unlike with [= aareUrl(); ?>](= postUrl('aare.li'); ?>), where I am using [ansi-escape-to-html](https://github.com/neilime/ansi-escapes-to-html) directly in the PHP script, this doesn't work with the Pokémon sprites as./neovim/.config/nvim/init.vim they are true color (24 million colors). I haven't found a php package that supports true color ANSI. But the Python package [ansi2html](https://github.com/pycontribs/ansi2html) does, so I am using that.
-----BEGIN PGP SIGNATURE-----
iQIzBAEBCgAdFiEE5lqFIPNq7hPP5PVr64/jMQY6R5QFAmR2ijkACgkQ64/jMQY6
R5SLLA//c1TKGJL7gfZjffZKN5puws6OViI+H0AWj3cghyG8/Hml3JWcd2Pb594f
StZJSCuJuTNQRVDmSFNa2c7RYnFCLNIkwYQam8FH1qXdzBF8Jf0hOVXcItWsKY36
qqZeADouyRrHJ9rcyVPvzj67aocsyRc1hxtHuB7K4kzDQKxj2sU0rRef3osFciXR
fxXKDA7qqAQ69fIDycpQVzcqMffZ753G/1wb6AQuzyDO82YNyXAquWUFRmwBClOr
/UgvM/8CrvY+xT0JMQldX7C6hTMqsJoUbSpryDJWKYbFXy3wXlrqRhUpiCr/s5cj
hMebfye9to3t/zndLdSltLtYkDNJRMZIqAF18knFP2clXDJry8nXVQEQ5kicuV5S
S6UyUusnYliEgLVq1h0b+zjLSaKLsjVMqKNZKKmu2Zqb+n+uGJ0Sxndf6GV/hak3
3pgLg8Nuyu2Hpg5B/nWx2JSCoxDwmIVDsEAwuUDXfTQcK/m3dqfTrowoF9KRnks0
oRKCaWRfrp+zXIPY5w5Z8lVUrxuuTMgaTajnViYrgzjbBxl0gosM1Bz4OtWlDM5E
ZNr5XyPW19bAfkF0fyVVqKOqOh6MuwcIebhTkrdVclnwgHfH9CAgMSfHBu4BpLz/
MAQReosS3IBCm6sY09IRXfO7IaaJxCnf+/tjDTb0AR3VPA9XnZ8=
=PePR
-----END PGP SIGNATURE-----