I have a bunch of raw pixel image dumps (they’re just pixel values, usually RGBA). Is there a macOS app that can not only open them but guess the image dimensions so I don’t have to manually know the dimensions?
@rosyna How could it guess that with just continuous pixel values? Or do you want something with a slider for the stride that you just slide till it looks right?
@ePirat @rosyna I think this is exactly where an algorithm may hook in. Two subsequent rows do look very similar. Also the number of pixels might hint towards the actual dimensions because the result was created via multiplication of two numbers.

@_karsten_ @ePirat Yeah, this is something an algorithm is good at. I must hang my head in shame as I’m currently using Claude Opus 4.6 to built a small algorithm for this.

I feed it an image it got wrong, it re-analyzes to make it appear correct. Makes sure all other correct images are still correct and updates the algorithm.

I was just hoping someone had already done this with an actual algorithm.

It’s a lot of division and adjacent pixel checking. Just math. Lots of math.

@rosyna @ePirat if you know the number of pixels I would say you only end up with a couple of pairs that are actual factors. This list is limited a lot by the possible aspect ratios. Once you are down to a couple of pairs, it’s just a question of detecting which of the sizes might be the most likely.
I guess that limits the use of math a lot, too
@_karsten_ @ePirat @rosyna hey ChatGPT convert these pixels into regular PNG files. I almost want to barf, but this might be what it's for!