Skip to content

Commit 7c05e03

Browse files
committed
Image
1 parent 20274f7 commit 7c05e03

File tree

2 files changed

+8
-8
lines changed

2 files changed

+8
-8
lines changed

README.md

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2703,16 +2703,16 @@ from PIL import Image
27032703
```
27042704

27052705
```python
2706-
<tuple/int> = <Image>.getpixel((x, y)) # Returns a pixel.
2707-
<Image>.putpixel((x, y), <tuple/int>) # Writes a pixel to the image.
2706+
<int/tuple> = <Image>.getpixel((x, y)) # Returns a pixel.
2707+
<Image>.putpixel((x, y), <int/tuple>) # Writes a pixel to the image.
27082708
<ImagingCore> = <Image>.getdata() # Returns a sequence of pixels.
27092709
<Image>.putdata(<list/ImagingCore>) # Writes a sequence of pixels.
27102710
<Image>.paste(<Image>, (x, y)) # Writes an image to the image.
27112711
```
27122712

27132713
```bash
2714-
<2d_array> = np.array(<Image>) # Creates NumPy array from greyscale image.
2715-
<3d_array> = np.array(<Image>) # Creates NumPy array from color image.
2714+
<2d_array> = np.array(<Image_L>) # Creates NumPy array from greyscale image.
2715+
<3d_array> = np.array(<Image_RGB>) # Creates NumPy array from color image.
27162716
<Image> = Image.fromarray(<array>) # Creates image from NumPy array of floats.
27172717
```
27182718

index.html

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2320,14 +2320,14 @@
23202320
&lt;Image&gt;.save(<span class="hljs-string">'&lt;path&gt;'</span>)
23212321
&lt;Image&gt;.show()
23222322
</code></pre>
2323-
<pre><code class="python language-python hljs">&lt;tuple/int&gt; = &lt;Image&gt;.getpixel((x, y)) <span class="hljs-comment"># Returns a pixel.</span>
2324-
&lt;Image&gt;.putpixel((x, y), &lt;tuple/int&gt;) <span class="hljs-comment"># Writes a pixel to the image.</span>
2323+
<pre><code class="python language-python hljs">&lt;int/tuple&gt; = &lt;Image&gt;.getpixel((x, y)) <span class="hljs-comment"># Returns a pixel.</span>
2324+
&lt;Image&gt;.putpixel((x, y), &lt;int/tuple&gt;) <span class="hljs-comment"># Writes a pixel to the image.</span>
23252325
&lt;ImagingCore&gt; = &lt;Image&gt;.getdata() <span class="hljs-comment"># Returns a sequence of pixels.</span>
23262326
&lt;Image&gt;.putdata(&lt;list/ImagingCore&gt;) <span class="hljs-comment"># Writes a sequence of pixels.</span>
23272327
&lt;Image&gt;.paste(&lt;Image&gt;, (x, y)) <span class="hljs-comment"># Writes an image to the image.</span>
23282328
</code></pre>
2329-
<pre><code class="bash language-bash hljs">&lt;2d_array&gt; = np.array(&lt;Image&gt;) <span class="hljs-comment"># Creates NumPy array from greyscale image.</span>
2330-
&lt;3d_array&gt; = np.array(&lt;Image&gt;) <span class="hljs-comment"># Creates NumPy array from color image.</span>
2329+
<pre><code class="bash language-bash hljs">&lt;2d_array&gt; = np.array(&lt;Image_L&gt;) <span class="hljs-comment"># Creates NumPy array from greyscale image.</span>
2330+
&lt;3d_array&gt; = np.array(&lt;Image_RGB&gt;) <span class="hljs-comment"># Creates NumPy array from color image.</span>
23312331
&lt;Image&gt; = Image.fromarray(&lt;array&gt;) <span class="hljs-comment"># Creates image from NumPy array of floats.</span>
23322332
</code></pre>
23332333
<div><h3 id="modes-1">Modes</h3><ul>

0 commit comments

Comments
 (0)