Get the latest tech news
Parsing PNG Images in Mojo
from pathlib import Path = Path('hopper.png') test_image print(test_image.exists()) True Ferdinand Schenck May 4, 2024 So for the past while I’ve been trying to follow along with the development of Mojo, but so far I’ve mostly just followed along with the changelog and written some pretty trivial pieces of code. In my last post I said I wanted to try something a bit more substantial, so here goes.
Don’t mistake this post for a tutorial: read it as someone discovering the gory details of the PNG standard while learning a new language. For the undo_filter function, I was trying to add the separate filters to some kind of Tuple or List so I could just index them (hence the uniform signatures), but wasn’t able to figure out how to do this in Mojo yet. I was looking at the Basalt project, which tries to build a Machine Learning framework in pure Mojo, and realized that the only images used so far were MNIST, which come in a weird binary format anyway.
Or read this on Hacker News