Orientation - Algorithmix/Picasso GitHub Wiki

  1. Take Blob b
  2. Rotate b one degree
  3. while rotated's area is greater than previous
  4. rotate one degree

This will ensure that the minimum area is taken up by the image. A simple 90 degree flip can be done if vertical/horizontal is desired