@Qrrbrbirlbel You might have seen the pull request with my take on memoizable scalepicture. I mention there that it might be nice to have a library creating \pgfpictureid from MD5 sum of the picture code. I cooked up something rudimentary: github.com/sasozivanovic/pgf-md5sumpictureid