OK -
Photoshop give you the following options when opening a raw file:
Width and height in pixels.
Channel count (number of colors).
Whether it’s interleaved or not.
Bit depth (8 or 16)
Byte order (Mac or PC)
Header size in bytes.
If your format can’t be described with those parameters, you won’t be able to open it correctly.
So, one target I have been thinking about making would have pixel brightness varying according to a sine wave of some frequency, or a sine wave of swept frequency, or a sine wave whose amplitude varies linearly, over one dimension of the image.
Another image I wanted recently would have had lines (rows or columns of pixels one pixel wide) whose spacing was a particular number of pixels.
A third would have turned on different colors at different points along a line to test whether the different colors were displaced relative to one another.
A forth application for images is testing whether other programs do anything “funny”, like spatial resampling to make slight adjustments in image size. One program, for example, gets each pixel value from the previous version’s pixel values in the four adjacent corners, so it loses one pixel width and also suppresses variability on a wavelength of two pixels, which has messed up one of my analyses.
I do a lot of my programming in the SAS statistics package, because it is a convenient package for calculations and testing out scientific ideas (and not so much to use statistical methods per se). And because I know it really well and am pretty fast with it, and it doesn’t keep reinventing itself every several years so that things I wrote decades ago are still (usually) runnable. But SAS doesn’t have a low level graphics capability.