Is the 90 degree image rotation with graphicsmagick or imagemagick always lossless?
E.g. when doing
gm convert -rotate 90 img.img rot90.img.img
gm convert -rotate -90 rot90.img.img back.img
will img.img and back.img be equal?
The answer to this depends more on the particular image format you're using, rather than the internals of Image/GraphicsMagick (assuming they're competently written).
With a raw format (e.g. BMP), there should be no reason for this not to be completely identical.
With a lossless format, it's possible there may be some subtle variations due to numerical precision.
With a lossy format (e.g. JPEG), it's almost certain there will be differences. In the case of JPEG for example, the compression of each 8x8 block is affected by the block to its left - if you rotate the image then that spatial relationship will change.