I think you can do it with the screenshot api
https://docs.cypress.io/api/cypress-api/screenshot-api
The Screenshot API allows you set defaults for how screenshots are captured during .screenshot and automatic screenshots taken during test failures. You can set defaults for the following: