@ -2263,7 +2263,7 @@ right = [[<span class="hljs-number">0.1</span>, <span class="hljs-number">0.1</
<Image> = Image.open(<path>) <spanclass="hljs-comment"># Identifies format based on file's contents.</span>
<Image> = <Image>.convert(<spanclass="hljs-string">'<mode>'</span>) <spanclass="hljs-comment"># Converts image to the new mode (see Modes).</span>
<Image>.save(<path>) <spanclass="hljs-comment"># Selects format based on extension (PNG/JPG…).</span>
<Image>.show() <spanclass="hljs-comment"># Opens image in the default preview app.</span>
<Image>.show() <spanclass="hljs-comment"># Displays image in default preview app.</span>
<ImgCore> = <Image>.getdata() <spanclass="hljs-comment"># Returns a flattened view of pixel values.</span>
@ -2275,7 +2275,7 @@ right = [[<span class="hljs-number">0.1</span>, <span class="hljs-number">0.1</
<Image> = <Enhance>.enhance(<float>) <spanclass="hljs-comment"># Use ImageEnhance.<name>(<Image>) for Enhance.</span>
</code></pre>
<pre><codeclass="python language-python hljs"><array> = np.array(<Image>) <spanclass="hljs-comment"># Creates a 2d/3d NumPy array from the image.</span>
<Image> = Image.fromarray(np.uint8(<array>)) <spanclass="hljs-comment"># Use `<array>.clip(0, 255)` to clip values.</span>
<Image> = Image.fromarray(np.uint8(<array>)) <spanclass="hljs-comment"># Use <array>.clip(0, 255) to clip the values.</span>
</code></pre>
<div><h3id="modes-1">Modes</h3><ul>
<li><strong><codeclass="python hljs"><spanclass="hljs-string">'L'</span></code> - Lightness (greyscale image). Each pixel is an int between 0 and 255.</strong></li>
xxxxxxxxxx