|
|
@ -2320,14 +2320,14 @@ right = [[<span class="hljs-number">0.1</span>, <span class="hljs-number">0.6</s |
|
|
|
<Image>.save(<span class="hljs-string">'<path>'</span>) |
|
|
|
<Image>.show() |
|
|
|
</code></pre> |
|
|
|
<pre><code class="python language-python hljs"><tuple/int> = <Image>.getpixel((x, y)) <span class="hljs-comment"># Returns a pixel.</span> |
|
|
|
<Image>.putpixel((x, y), <tuple/int>) <span class="hljs-comment"># Writes a pixel to the image.</span> |
|
|
|
<pre><code class="python language-python hljs"><int/tuple> = <Image>.getpixel((x, y)) <span class="hljs-comment"># Returns a pixel.</span> |
|
|
|
<Image>.putpixel((x, y), <int/tuple>) <span class="hljs-comment"># Writes a pixel to the image.</span> |
|
|
|
<ImagingCore> = <Image>.getdata() <span class="hljs-comment"># Returns a sequence of pixels.</span> |
|
|
|
<Image>.putdata(<list/ImagingCore>) <span class="hljs-comment"># Writes a sequence of pixels.</span> |
|
|
|
<Image>.paste(<Image>, (x, y)) <span class="hljs-comment"># Writes an image to the image.</span> |
|
|
|
</code></pre> |
|
|
|
<pre><code class="bash language-bash hljs"><2d_array> = np.array(<Image>) <span class="hljs-comment"># Creates NumPy array from greyscale image.</span> |
|
|
|
<3d_array> = np.array(<Image>) <span class="hljs-comment"># Creates NumPy array from color image.</span> |
|
|
|
<pre><code class="bash language-bash hljs"><2d_array> = np.array(<Image_L>) <span class="hljs-comment"># Creates NumPy array from greyscale image.</span> |
|
|
|
<3d_array> = np.array(<Image_RGB>) <span class="hljs-comment"># Creates NumPy array from color image.</span> |
|
|
|
<Image> = Image.fromarray(<array>) <span class="hljs-comment"># Creates image from NumPy array of floats.</span> |
|
|
|
</code></pre> |
|
|
|
<div><h3 id="modes-1">Modes</h3><ul> |
|
|
|