This has to do with Imagick's internals. The frame resource needs to be replaced with the altered version. If you look at merge() the same thing is done there for the same reason. If we don't do this, it never actually updates the frames.