fix #31856: add option to trim whitespace from exported PNG