miriam_e: from my drawing MoonGirl (Default)
[personal profile] miriam_e
I've spent the past week or more trying to create a program to view a netpbm image and update the display the moment it changes. However I am a truly terrible C programmer, so I've been getting ChatGPT-4o to help me. Problem is, GPT-4 is almost as bad as I am at C, but for a different reason. In a simple C program it is much better than I am, but when a program reaches any degree of complexity, doing multiple things, then GPT-4 is frustratingly bad at remembering the goals. Working on the program became an interminable merry-go-round of solving one problem, only to have a previously solved one revert. And I have insufficient skill to stitch together the parts that work in order to make a full, working program.

I tried breaking the program into smaller functions that could be solved in isolation, but that surprisingly made things worse because they got out of step, with one part calling another with the wrong parameters.

All this became moot when I re-read the manual of "feh" a small image display program which is supposed to update the display anytime the image is altered. My version of feh doesn't. It seems the binary I installed didn't have that ability, so I recompiled the source code, and yay! My freshly compiled version of feh does what I've been struggling to do with the help of GPT-4 for more than a week.

So... why do I want a program to continually update any changes to the display of netpbm files?

There are 6 variants of the netpbm image file formats, and 3 of them are plain text. The pixels are represented as just strings of space-separated "0" (white) and "1" (black) for monochrome (pbm), or strings of space-separated decimal numbers for gray-scale (pgm), or strings of space-separated decimal numbers representing red, green, and blue (ppm).

My favorite general-purpose programming language is currently awk, which shines best at handling text. But I want to do more graphics in the near future. Using awk to manipulate a text-based image format is a perfect solution... if I can have a way to immediately display my results. I now have that last part of the puzzle: feh.

Yay!

Profile

miriam_e: from my drawing MoonGirl (Default)
miriam_e

February 2026

S M T W T F S
123 4 567
891011121314
15161718192021
22232425262728

Style Credit

Expand Cut Tags

No cut tags
Page generated Saturday, 7 February 2026 03:26 pm
Powered by Dreamwidth Studios