This is a problem which I found to be quite challenging. I ask this because I want to be able to losslessly compress simply connected shapes (connected shapes without holes) with fewer bits than $n^2$, which can have many downstream applications.
By connectedness, I do not restrict it to be either 4-connectedness or 8-connectedness, I just would like an answer that gets us to the approximately correct order of magnitude of the number of connected shapes, so an answer may be given for either definition of connectedness, if one of the definitions proves to be easier to work with.
I consider two connected shapes to be the same if and only if the two n by n images on which the shapes are represented are exactly the same pixel-wise. Hence, translation and rotation of a shape will likely result in a new shape under my definition.
Finally, if an exact, or approximate solution is difficult to come by, I am willing to accept a good upper bound estimate of the form $O(2^{c\times n^k})$ where k should ideally be less than 2, and c is some constant. (If it turns out that the minimum of k must be 2, it is fine, too, if there is a proof.)
