Add gifify formula

Updated formula for #25072
I've added a test using the example provided by @mistydemeo.