@ -2259,7 +2259,7 @@ Line # Mem usage Increment Line Contents
3 38.012 MiB 0.344 MiB a = [*range(10000)]
4 38.477 MiB 0.465 MiB b = {*range(10000)}
</code></pre>
<div><h3id="callgraph">Call Graph</h3><div><h4id="generatesapngimageofacallgraphwithhighlightedbottlenecks">Generates a PNG image of a call graph with highlighted bottlenecks:</h4><pre><codeclass="python language-python hljs"><spanclass="hljs-comment"># $ pip3 install pycallgraph2</span>
<div><h3id="callgraph">Call Graph</h3><div><h4id="generatesapngimageofthecallgraphwithhighlightedbottlenecks">Generates a PNG image of the call graph with highlighted bottlenecks:</h4><pre><codeclass="python language-python hljs"><spanclass="hljs-comment"># $ pip3 install pycallgraph2</span>
@ -2368,8 +2368,8 @@ right = [[<span class="hljs-number">0.1</span>, <span class="hljs-number">0.6</s
<li><strong><codeclass="python hljs"><spanclass="hljs-string">'RGBA'</span></code> - 4x8-bit pixels, true color with transparency mask.</strong></li>
<li><strong><codeclass="python hljs"><spanclass="hljs-string">'HSV'</span></code> - 3x8-bit pixels, Hue, Saturation, Value color space.</strong></li>
</ul><div><h3id="examples">Examples</h3><div><h4id="createsapngimageofarainbowgradient">Creates a PNG image of a rainbow gradient:</h4><pre><codeclass="python language-python hljs">WIDTH, HEIGHT = <spanclass="hljs-number">100</span>, <spanclass="hljs-number">100</span>
size = WIDTH * HEIGHT
hues = (<spanclass="hljs-number">255</span> * i/size<spanclass="hljs-keyword">for</span> i <spanclass="hljs-keyword">in</span> range(size))
n_pixels = WIDTH * HEIGHT
hues = (<spanclass="hljs-number">255</span> * i/n_pixels<spanclass="hljs-keyword">for</span> i <spanclass="hljs-keyword">in</span> range(n_pixels))