def get_grey(self, tex, fontsize=None, dpi=None):
key = tex, self.get_font_config(), fontsize, dpi<EOL>alpha = self.grey_arrayd.get(key)<EOL>if alpha is None:<EOL><INDENT>pngfile = self.make_png(tex, fontsize, dpi)<EOL>X = read_png(os.path.join(self.texcache, pngfile))<EOL>if rcParams['<STR_LIT>'] is not None:<EOL><INDENT>hack = rcParams['<STR_LIT>']<EOL><DEDENT>else:<EOL><INDENT>hack = self._dvipng_hack_alpha<EOL><DEDENT>if hack:<EOL><INDENT>alpha = <NUM_LIT:1>-X[:,:,<NUM_LIT:0>]<EOL><DEDENT>else:<EOL><INDENT>alpha = X[:,:,-<NUM_LIT:1>]<EOL><DEDENT>self.grey_arrayd[key] = alpha<EOL><DEDENT>return alpha<EOL>
returns the alpha channel