Hacker News new | ask | show | jobs
by jszymborski 926 days ago
Defeats the purpose a bit, but its far easier to type out a PBM [0] file by hand and then just convert it to gif using e.g. imagemagick

[0] https://en.wikipedia.org/wiki/Netpbm

2 comments

There's a cute plugin[0] for Vim which converts any image to XPM, which is a similar format that Vim has syntax-coloring for. You can edit the text, and then on save, it will get converted back to the original format. I've used it a few times to quickly preview an image or edit a favicon. It's more of party trick than seriously useful, though.

[0]https://github.com/tpope/vim-afterimage

Not even just manually typing... Last time I wanted to have a program save a picture [0] it was easiest to write PPM and then convert that to a real format. Super inefficient file sizes, but good tradeoff for a hobby project. I can take some big intermediate files in exchange for not needing a graphics file format library:)

[0] I was playing with the Linux framebuffer and wrote - among other things - a screenshot tool.