compression and resize