added autocrop option. Speedup: don't parse invisible layers.