Removes excess pixels from testing.