-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathdesktopwallpaper.html
1415 lines (1399 loc) · 151 KB
/
desktopwallpaper.html
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8">
<title>Python: module desktopwallpaper</title>
</head><body>
<table class="heading">
<tr class="heading-text decor">
<td class="title"> <br><strong class="title">desktopwallpaper</strong></td>
<td class="extra"><a href=".">index</a></td></tr></table>
<p><span class="code"># This Python script helps generate interesting variations on desktop<br>
# wallpapers based on existing image files. Because they run on the CPU<br>
# and are implemented in pure Python, the methods are intended for<br>
# relatively small images that are suitable as tileable desktop wallpaper<br>
# patterns, especially with dimensions 256 &times; 256 or smaller.<br>
#<br>
# This script is released to the public domain; in case that is not possible, the<br>
# file is also licensed under the Unlicense: <a href="https://unlicense.org/">https://unlicense.org/</a><br>
#<br>
# NOTES:<br>
#<br>
# 1. Animation of tilings composed from a wallpaper image can be implemented by<br>
# shifting, with each frame, the starting position for drawing the upper left<br>
# corner of the wallpaper tiling (for example, from the upper-left corner of the image<br>
# to some other position in the image).<br>
# 2. In Windows, if both an 8 &times; 8 two-level pattern and a centered wallpaper<br>
# are set as the desktop background, a tiling of the pattern and the wallpaper<br>
# will be drawn on the desktop, the latter appearing above the former. Areas of the<br>
# two-level pattern where the pixel is 1 are drawn as "black", and other areas are<br>
# drawn as the desktop color.<br>
# 3. I would welcome it if readers could contribute computer code (released<br>
# to the public domain or under the Unlicense) to generate tileable—<br>
# - noise,<br>
# - procedural textures or patterns, or<br>
# - arrangements of symbols or small images with partial transparency,<br>
# without artificial intelligence, with a limited color palette and a small<br>
# resolution, as long as the resulting images do not employ<br>
# trademarks and are suitable for all ages. For details on the color and<br>
# resolution options as well as a broader challenge to generate tileable<br>
# classic wallpapers, see:<br>
#<br>
# <a href="https://github.com/peteroupc/classic-wallpaper">https://github.com/peteroupc/classic-wallpaper</a><br>
#</span></p>
<p>
<table class="section">
<tr class="decor pkg-content-decor heading-text">
<td class="section-title" colspan=3> <br><strong class="bigsection">Modules</strong></td></tr>
<tr><td class="decor pkg-content-decor"><span class="code"> </span></td><td> </td>
<td class="singlecolumn"><table><tr><td class="multicolumn"><a href="math.html">math</a><br>
<a href="os.html">os</a><br>
</td><td class="multicolumn"><a href="random.html">random</a><br>
<a href="struct.html">struct</a><br>
</td><td class="multicolumn"><a href="sys.html">sys</a><br>
</td><td class="multicolumn"></td></tr></table></td></tr></table><p>
<table class="section">
<tr class="decor index-decor heading-text">
<td class="section-title" colspan=3> <br><strong class="bigsection">Classes</strong></td></tr>
<tr><td class="decor index-decor"><span class="code"> </span></td><td> </td>
<td class="singlecolumn"><dl>
<dt class="heading-text"><a href="builtins.html#object">builtins.object</a>
</dt><dd>
<dl>
<dt class="heading-text"><a href="desktopwallpaper.html#ImageWraparoundDraw">ImageWraparoundDraw</a>
</dt><dt class="heading-text"><a href="desktopwallpaper.html#SvgDraw">SvgDraw</a>
</dt><dt class="heading-text"><a href="desktopwallpaper.html#WindowsMetafileDraw">WindowsMetafileDraw</a>
</dt></dl>
</dd>
</dl>
<p>
<table class="section">
<tr class="decor title-decor heading-text">
<td class="section-title" colspan=3> <br><a name="ImageWraparoundDraw">class <strong>ImageWraparoundDraw</strong></a>(<a href="builtins.html#object">builtins.object</a>)</td></tr>
<tr><td class="decor title-decor" rowspan=2><span class="code"> </span></td>
<td class="decor title-decor" colspan=2><span class="code"><a href="#ImageWraparoundDraw">ImageWraparoundDraw</a>(image, width, height)<br>
<br>
<br> </span></td></tr>
<tr><td> </td>
<td class="singlecolumn">Methods defined here:<br>
<dl><dt><a name="ImageWraparoundDraw-__init__"><strong>__init__</strong></a>(self, image, width, height)</dt><dd><span class="code">Initialize self. See help(type(self)) for accurate signature.</span></dd></dl>
<dl><dt><a name="ImageWraparoundDraw-rect"><strong>rect</strong></a>(self, x0, y0, x1, y1, c)</dt></dl>
<hr>
Data descriptors defined here:<br>
<dl><dt><strong>__dict__</strong></dt>
<dd><span class="code">dictionary for instance variables</span></dd>
</dl>
<dl><dt><strong>__weakref__</strong></dt>
<dd><span class="code">list of weak references to the object</span></dd>
</dl>
</td></tr></table> <p>
<table class="section">
<tr class="decor title-decor heading-text">
<td class="section-title" colspan=3> <br><a name="SvgDraw">class <strong>SvgDraw</strong></a>(<a href="builtins.html#object">builtins.object</a>)</td></tr>
<tr><td class="decor title-decor"><span class="code"> </span></td><td> </td>
<td class="singlecolumn">Methods defined here:<br>
<dl><dt><a name="SvgDraw-__init__"><strong>__init__</strong></a>(self)</dt><dd><span class="code">Initialize self. See help(type(self)) for accurate signature.</span></dd></dl>
<dl><dt><a name="SvgDraw-__str__"><strong>__str__</strong></a>(self)</dt><dd><span class="code">Return str(self).</span></dd></dl>
<dl><dt><a name="SvgDraw-rect"><strong>rect</strong></a>(self, x0, y0, x1, y1, c)</dt></dl>
<dl><dt><a name="SvgDraw-toSvg"><strong>toSvg</strong></a>(self, width, height)</dt></dl>
<hr>
Data descriptors defined here:<br>
<dl><dt><strong>__dict__</strong></dt>
<dd><span class="code">dictionary for instance variables</span></dd>
</dl>
<dl><dt><strong>__weakref__</strong></dt>
<dd><span class="code">list of weak references to the object</span></dd>
</dl>
</td></tr></table> <p>
<table class="section">
<tr class="decor title-decor heading-text">
<td class="section-title" colspan=3> <br><a name="WindowsMetafileDraw">class <strong>WindowsMetafileDraw</strong></a>(<a href="builtins.html#object">builtins.object</a>)</td></tr>
<tr><td class="decor title-decor"><span class="code"> </span></td><td> </td>
<td class="singlecolumn">Methods defined here:<br>
<dl><dt><a name="WindowsMetafileDraw-__init__"><strong>__init__</strong></a>(self)</dt><dd><span class="code">Initialize self. See help(type(self)) for accurate signature.</span></dd></dl>
<dl><dt><a name="WindowsMetafileDraw-rect"><strong>rect</strong></a>(self, x0, y0, x1, y1, c)</dt></dl>
<dl><dt><a name="WindowsMetafileDraw-toMetafile"><strong>toMetafile</strong></a>(self)</dt></dl>
<hr>
Data descriptors defined here:<br>
<dl><dt><strong>__dict__</strong></dt>
<dd><span class="code">dictionary for instance variables</span></dd>
</dl>
<dl><dt><strong>__weakref__</strong></dt>
<dd><span class="code">list of weak references to the object</span></dd>
</dl>
</td></tr></table></td></tr></table><p>
<table class="section">
<tr class="decor functions-decor heading-text">
<td class="section-title" colspan=3> <br><strong class="bigsection">Functions</strong></td></tr>
<tr><td class="decor functions-decor"><span class="code"> </span></td><td> </td>
<td class="singlecolumn"><dl><dt><a name="-affine"><strong>affine</strong></a>(
dstimage,
dstwidth,
dstheight,
srcimage,
srcwidth,
srcheight,
m11,
m12,
m21,
m22,
alpha=False,
smoothing=True
)</dt><dd><span class="code"># Images have the same format returned by the <a href="#-blankimage">blankimage</a>() method with the specified value of 'alpha' (default value for 'alpha' is False).</span></dd></dl>
<dl><dt><a name="-alphaToTwoLevel"><strong>alphaToTwoLevel</strong></a>(image, width, height, dither=False)</dt><dd><span class="code"># Modifies the specified 4-byte-per-pixel image by<br>
# converting its 256-level alpha channel to two levels (opaque<br>
# and transparent).<br>
# Image has the same format returned by the <a href="#-blankimage">blankimage</a>() method with alpha=True.<br>
# If 'dither' is True, the conversion is done by dithering, that<br>
# is, by scattering opaque and transparent pixels to simulate<br>
# pixels between the two extremes. (Reducing the alpha channel<br>
# by dithering is also known as stippled or screen-door<br>
# transparency.) If False, the conversion is<br>
# done by thresholding: alpha values 127 or below become 0 (transparent), and<br>
# alpha values 128 or higher become 255 (opaque). Default is False</span></dd></dl>
<dl><dt><a name="-argyle"><strong>argyle</strong></a>(
foregroundImage,
backgroundImage,
width,
height,
expo=1,
shiftImageBg=False,
alpha=False
)</dt><dd><span class="code"># Generates a tileable argyle pattern from two images of the<br>
# same size. The images have the same format returned by the <a href="#-blankimage">blankimage</a>()<br>
# method with the specified value of 'alpha' (default value for 'alpha' is False). 'backgroundImage' must be tileable if shiftImageBg=False;<br>
# 'foregroundImage' need not be tileable.<br>
# 'expo' is a parameter that determines the shape in the middle of the image,<br>
# and can be any number greater than 0. If 1, the shape resembles a<br>
# diamond; if 2, an ellipse. Default is 1.</span></dd></dl>
<dl><dt><a name="-backgroundColorUnder"><strong>backgroundColorUnder</strong></a>(bgcolor=None)</dt><dd><span class="code"># ImageMagick command to put a background color behind the input image.<br>
# 'bgcolor' is the background color,<br>
# either None or a 3-element list of the red,<br>
# green, and blue components in that order; for example, [2,10,255] where each<br>
# component is from 0 through 255; default is None, or no background color.</span></dd></dl>
<dl><dt><a name="-basrelief"><strong>basrelief</strong></a>(bg=None, highlight=None, shadow=None)</dt><dd><span class="code"># ImageMagick command.<br>
# bg is treated as [192, 192, 192] if None.<br>
# highlight is treated as [255, 255, 255] if None.<br>
# shadow is treated as [0, 0, 0] if None.</span></dd></dl>
<dl><dt><a name="-blankimage"><strong>blankimage</strong></a>(width, height, color=None, alpha=False)</dt><dd><span class="code"># Creates a blank image with 3 or 4 bytes per pixel and the specified width, height,<br>
# and fill color.<br>
#<br>
# The image is in the form of a list with a number of<br>
# elements equal to width*height*3 (or width*height*4 if 'alpha' is True). The<br>
# array is divided into 'height' many rows running from top to bottom. Each row<br>
# is divided into 'width' many pixels (one pixel for each column from left to<br>
# right), with three elements per pixel (or four elements if 'alpha' is True).<br>
# In each pixel, which represents a color at the specified row and column, the<br>
# first element is the color's red component; the second, its blue component;<br>
# the third, its red component; the fourth, if present, is the color's alpha<br>
# component or _opacity_ (0 if the color is transparent; 255 if opaque; otherwise,<br>
# the color is translucent or semitransparent). Each component is an integer<br>
# from 0 through 255. In this format, lower-intensity red, green, or blue components are<br>
# generally "darker", higher-intensity components "lighter", so that [0,0,0,255] (4 bytes per pixel)<br>
# or [0,0,0] (3 bytes per pixel) is "black", and [255,255,255,255] or [255,255,255] is "white".<br>
# Each color in the returned image is assumed to be in the nonlinear sRGB color space.<br>
#<br>
# 'color' is the fill color; if 'color' is None, the fill color is [255,255,255,255], or white.<br>
# If 'alpha' is True, generates a 4-byte-per-pixel image; if False, generates a<br>
# 3-byte-per-pixel image. The default is False.<br>
#<br>
# Blending Note: Operations that involve the blending of two RGB (red-green-<br>
# blue) colors work best if the RGB color space is linear. This is not the case<br>
# for the sRGB color space, which is the color space assumed for images created<br>
# using the <a href="#-blankimage">blankimage</a>() method. Moreover, converting an image from a nonlinear<br>
# to a linear color space and back can lead to data loss especially if the image's color<br>
# components are 8 bits or fewer in length (as with images returned by <a href="#-blankimage">blankimage</a>()).<br>
# This function does not do any such conversion.</span></dd></dl>
<dl><dt><a name="-borderedbox"><strong>borderedbox</strong></a>(
image,
width,
height,
border,
color1,
color2,
x0,
y0,
x1,
y1,
wraparound=True
)</dt><dd><span class="code"># Draw a wraparound dither-colored box on an image.<br>
# Image has the same format returned by the <a href="#-blankimage">blankimage</a>() method with alpha=False.<br>
# 'border' is the color of the 1-pixel-thick border. Can be None (so<br>
# that no border is drawn)<br>
# 'color1' and 'color2' are the dithered<br>
# versions of the inner color. 'color1' and 'color2' can't be None.</span></dd></dl>
<dl><dt><a name="-bordereddithergradientbox"><strong>bordereddithergradientbox</strong></a>(
image,
width,
height,
border,
color1,
color2,
contour,
x0,
y0,
x1,
y1,
wraparound=True
)</dt><dd><span class="code"># Image has the same format returned by the <a href="#-blankimage">blankimage</a>() method with alpha=False.<br>
# Draw a wraparound box in a two-color dithered gradient fill on an image.<br>
# 'border' is the color of the 1-pixel-thick border. Can be None (so<br>
# that no border is drawn)<br>
# 'color1' and 'color2' are the dithered<br>
# versions of the inner color. 'color1' and 'color2' can't be None.</span></dd></dl>
<dl><dt><a name="-borderedgradientbox"><strong>borderedgradientbox</strong></a>(
image,
width,
height,
border,
gradient,
contour,
x0,
y0,
x1,
y1,
wraparound=True,
jitter=False
)</dt><dd><span class="code"># Image has the same format returned by the <a href="#-blankimage">blankimage</a>() method with alpha=False.<br>
# Draw a wraparound box in a gradient fill on an image.<br>
# 'border' is the color of the 1-pixel-thick border. Can be None (so<br>
# that no border is drawn)<br>
# 'gradient' is a list of 256 colors for mapping the 256 possible shades<br>
# of the gradient fill.<br>
# 'contour' is a function that takes two parameters and returns a number in [-1, 1].<br>
# Each parameter is in [0, 1] and gives x- and y-coordinate of a point in<br>
# the box: (0,0) is the upper-left corner; (1,1) is the lower-right, assuming the positive<br>
# x-axis points to the right and the positive y-axis downward. The return value<br>
# of 'contour', as its absolute value, is a point along the gradient in which to color<br>
# the specified point: 0 means first color in the gradient; 1 and -1 mean the last<br>
# color in the gradient; points in between are intermediate colors along the gradient.</span></dd></dl>
<dl><dt><a name="-brushedmetal"><strong>brushedmetal</strong></a>()</dt><dd><span class="code"># ImageMagick command to generate a brushed metal texture from a noise image.<br>
# A brushed metal texture was featured in Mac OS X Panther and<br>
# Tiger (10.3, 10.4) and other Apple products<br>
# around the time of either operating system's release.</span></dd></dl>
<dl><dt><a name="-brushednoise"><strong>brushednoise</strong></a>(width, height, tileable=True)</dt><dd><span class="code"># Returns an image with the same format returned by the <a href="#-blankimage">blankimage</a>() method with alpha=False.</span></dd></dl>
<dl><dt><a name="-brushednoise2"><strong>brushednoise2</strong></a>(width, height, tileable=True)</dt><dd><span class="code"># Returns an image with the same format returned by the <a href="#-blankimage">blankimage</a>() method with alpha=False.</span></dd></dl>
<dl><dt><a name="-brushednoise3"><strong>brushednoise3</strong></a>(width, height, tileable=True)</dt><dd><span class="code"># Returns an image with the same format returned by the <a href="#-blankimage">blankimage</a>() method with alpha=False.</span></dd></dl>
<dl><dt><a name="-buttondown"><strong>buttondown</strong></a>(helper, x0, y0, x1, y1, hilt, lt, sh, dksh, face=None)</dt></dl>
<dl><dt><a name="-buttonup"><strong>buttonup</strong></a>(helper, x0, y0, x1, y1, hilt, lt, sh, dksh, face=None)</dt></dl>
<dl><dt><a name="-cgacolors"><strong>cgacolors</strong></a>()</dt><dd><span class="code"># Canonical 16-color CGA palette<br>
# see also: <a href="https://int10h.org/blog/2022/06/ibm-5153-color-true-cga-palette/">https://int10h.org/blog/2022/06/ibm-5153-color-true-cga-palette/</a><br>
# Each element in the return value is a color in the form of a 3-element list of its red,<br>
# green, and blue components in that order, where each<br>
# component is an integer from 0 through 255.</span></dd></dl>
<dl><dt><a name="-checkerboard"><strong>checkerboard</strong></a>(
upperLeftImage,
otherImage,
width,
height,
columns=2,
rows=2,
alpha=False
)</dt><dd><span class="code"># Generates a tileable checkerboard pattern made of parts of two images of the same size;<br>
# the return value has the same width and height as the source images.<br>
# The two images should be tileable.<br>
# The images have the same format returned by the <a href="#-blankimage">blankimage</a>() method with<br>
# the specified value of 'alpha' (the default value for 'alpha' is False).<br>
# The number of columns and of rows must be even and positive.</span></dd></dl>
<dl><dt><a name="-checkerboardtile"><strong>checkerboardtile</strong></a>(
upperLeftImage,
otherImage,
width,
height,
columns=2,
rows=2,
alpha=False
)</dt><dd><span class="code"># Generates a tileable checkerboard pattern using two images of the same size;<br>
# each tile is the whole of one of the source images, and the return value's<br>
# width in pixels is width*columns; its height is height*rows.<br>
# The two images should be tileable.<br>
# The images have the same format returned by the <a href="#-blankimage">blankimage</a>() method with<br>
# the specified value of 'alpha' (the default value for 'alpha' is False).<br>
# The number of columns and of rows must be even and positive.</span></dd></dl>
<dl><dt><a name="-circledraw"><strong>circledraw</strong></a>(image, width, height, c, cx, cy, r, wraparound=True)</dt><dd><span class="code"># Draws a circle that optionally wraps around.<br>
# Image has the same format returned by the <a href="#-blankimage">blankimage</a>() method with alpha=False.</span></dd></dl>
<dl><dt><a name="-classiccolors"><strong>classiccolors</strong></a>()</dt><dd><span class="code"># 16-color VGA palette<br>
# Each element in the return value is a color in the form of a 3-element list of its red,<br>
# green, and blue components in that order, where each<br>
# component is an integer from 0 through 255.</span></dd></dl>
<dl><dt><a name="-classiccolors2"><strong>classiccolors2</strong></a>()</dt><dd><span class="code"># Colors in <a href="#-classiccolors">classiccolors</a>() and their "half-and-half" versions.<br>
# Each element in the return value is a color in the form of a 3-element list of its red,<br>
# green, and blue components in that order, where each<br>
# component is an integer from 0 through 255.</span></dd></dl>
<dl><dt><a name="-cm"><strong>cm</strong></a>(x, y)</dt><dd><span class="code"># Wallpaper group Cm. Source triangle is formed from the upper-left, lower-left,<br>
# and lower-right corners of a rectangle that covers the whole destination image.<br>
# To generate seamless images with this group function, the source shape should<br>
# satisfy the following: Left edge is same as lower edge.</span></dd></dl>
<dl><dt><a name="-cmm"><strong>cmm</strong></a>(x, y)</dt><dd><span class="code"># Wallpaper group Cmm. Source triangle is formed from the upper midpoint,<br>
# lower-left corner, and lower-right corner of a rectangle that takes the lower<br>
# half of the destination image. To generate seamless images with this group<br>
# function, the source shape should satisfy the following: Lower edge is mirrored.</span></dd></dl>
<dl><dt><a name="-colorgradient"><strong>colorgradient</strong></a>(blackColor, whiteColor)</dt><dd><span class="code"># Returns a 256-element color gradient starting at 'blackColor' and ending at 'whiteColor'.<br>
# 'blackColor' and 'whiteColor' are each three-element lists identifying colors.</span></dd></dl>
<dl><dt><a name="-convolveRow"><strong>convolveRow</strong></a>(image, width, height)</dt><dd><span class="code"># Image has the same format returned by the <a href="#-blankimage">blankimage</a>() method with alpha=False.</span></dd></dl>
<dl><dt><a name="-darkmodePattern"><strong>darkmodePattern</strong></a>()</dt><dd><span class="code"># ImageMagick command for setting a gray (128,128,128) foreground pattern on a black (0,0,0) background.</span></dd></dl>
<dl><dt><a name="-diamondTiled"><strong>diamondTiled</strong></a>(bgcolor=None, kind=0)</dt><dd><span class="code"># kind=0: image drawn in middle and padded<br>
# kind=1: brick drawn at top<br>
# kind=2: brick drawn at left</span></dd></dl>
<dl><dt><a name="-diamondTiledSize"><strong>diamondTiledSize</strong></a>(width, height, kind)</dt></dl>
<dl><dt><a name="-diamondTiling"><strong>diamondTiling</strong></a>()</dt><dd><span class="code"># ImageMagick command to generate a diamond tiling pattern (or a brick tiling<br>
# pattern if the image the command is applied to has only its top half<br>
# or its bottom half drawn). For best results, the command should be applied<br>
# to images with an even width and height.</span></dd></dl>
<dl><dt><a name="-diamondgroup"><strong>diamondgroup</strong></a>(x, y, groupFunc=None)</dt><dd><span class="code"># Wallpaper group function that wraps another<br>
# group function ('groupFunc'), in which the image<br>
# after applying 'groupFunc'<br>
# is rotated and scaled to fit into<br>
# a diamond that touches the canvas's edges.<br>
# This diamond will repeat to cover the rest of<br>
# the canvas.<br>
# If 'groupFunc' is None, 'groupFunc' is treated<br>
# as the function <a href="#-p4m">p4m</a>().<br>
# This function is a variation of the<br>
# wallpaper group implemented by 'groupFunc'; for example, if<br>
# 'groupFunc' is a variation of wallpaper group P3m1,<br>
# so is this group function.<br>
# The source is recommended to meet the same requirements<br>
# as those for 'groupFunc' to generate<br>
# seamless images with this group function.</span></dd></dl>
<dl><dt><a name="-dithertograyimage"><strong>dithertograyimage</strong></a>(
image,
width,
height,
grays,
alpha=False,
ignoreNonGrays=False
)</dt><dd><span class="code"># Converts the image to grayscale and dithers the resulting image<br>
# to the gray tones given.<br>
# Image has the same format returned by the <a href="#-blankimage">blankimage</a>() method with the<br>
# given value of 'alpha' (default value for 'alpha' is False).<br>
# 'grays' is a sorted list of gray tones. Each gray tone must be an integer<br>
# from 0 through 255. The list must have a length of 2 or greater.<br>
# 'grays' can be None, in which case this method behaves like 'graymap'.<br>
# If 'ignoreNonGrays' is True, just dither the gray tones and leave the other<br>
# colors in the image unchanged. Default is False.</span></dd></dl>
<dl><dt><a name="-doubleargyle"><strong>doubleargyle</strong></a>(
fgcolor1,
fgcolor2,
bgcolor,
linecolor1,
linecolor2,
w,
h,
alpha=False
)</dt><dd><span class="code"># The returned image has the same format returned by the <a href="#-blankimage">blankimage</a>() method with<br>
# the specified value of 'alpha' (the default value for 'alpha' is False).<br>
# Returned image's width is twice 'w' and its height is twice 'h'.</span></dd></dl>
<dl><dt><a name="-doubleargyleimage"><strong>doubleargyleimage</strong></a>(fg1Image, fg2Image, bgImage, w, h, alpha=False)</dt><dd><span class="code"># 'fg1Image', 'fg2Image', and 'bgImage' have width 'w' and height 'h'.<br>
# These images and the return value have the same format returned by the <a href="#-blankimage">blankimage</a>() method with<br>
# the specified value of 'alpha' (the default value for 'alpha' is False).<br>
# Returned image's width is twice 'w' and its height is twice 'h'.</span></dd></dl>
<dl><dt><a name="-draw16button"><strong>draw16button</strong></a>(
helper,
x0,
y0,
x1,
y1,
hilt,
sh,
btn,
frame=None,
squareFrame=False,
isDefault=False
)</dt><dd><span class="code"># Draws a button in 16-bit style</span></dd></dl>
<dl><dt><a name="-draw16buttonpush"><strong>draw16buttonpush</strong></a>(
helper,
x0,
y0,
x1,
y1,
hilt,
sh,
btn,
frame=None,
squareFrame=False,
isDefault=False
)</dt><dd><span class="code"># Draws a pressed button in 16-bit style</span></dd></dl>
<dl><dt><a name="-drawRoundOrSquareEdge"><strong>drawRoundOrSquareEdge</strong></a>(helper, x0, y0, x1, y1, lt, sh, squareFrame=False)</dt></dl>
<dl><dt><a name="-drawbutton"><strong>drawbutton</strong></a>(
helper,
x0,
y0,
x1,
y1,
hilt,
lt,
sh,
dksh,
btn,
frame,
squareFrame=True,
isDefault=False
)</dt></dl>
<dl><dt><a name="-drawbuttonpush"><strong>drawbuttonpush</strong></a>(
helper,
x0,
y0,
x1,
y1,
hilt,
lt,
sh,
dksh,
btn,
frame,
squareFrame=True,
isDefault=False
)</dt></dl>
<dl><dt><a name="-drawdiagstripe"><strong>drawdiagstripe</strong></a>(image, width, height, stripesize, reverse, fgcolor=None)</dt><dd><span class="code"># Image has the same format returned by the <a href="#-blankimage">blankimage</a>() method with alpha=False.<br>
# 'stripesize' is in pixels<br>
# reverse=false: stripe runs from upper left to bottom<br>
# right assuming the image's first row is the top row<br>
# reverse=true: stripe runs from upper right to bottom<br>
# left</span></dd></dl>
<dl><dt><a name="-drawedgebotdom"><strong>drawedgebotdom</strong></a>(helper, x0, y0, x1, y1, upper, lower, edgesize=1, bordersize=1)</dt><dd><span class="code"># helper for edge drawing (lower right edge "dominates")</span></dd></dl>
<dl><dt><a name="-drawedgenodom"><strong>drawedgenodom</strong></a>(
helper,
x0,
y0,
x1,
y1,
upper,
lower,
corner,
edgesize=1,
bordersize=1
)</dt><dd><span class="code"># helper for edge drawing (neither edge "dominates")</span></dd></dl>
<dl><dt><a name="-drawedgetopdom"><strong>drawedgetopdom</strong></a>(helper, x0, y0, x1, y1, upper, lower, edgesize=1, bordersize=1)</dt><dd><span class="code"># helper for edge drawing (upper left edge "dominates")</span></dd></dl>
<dl><dt><a name="-drawhatchcolumns"><strong>drawhatchcolumns</strong></a>(image, width, height, hatchdist=8, hatchthick=1, fgcolor=None)</dt><dd><span class="code"># Image has the same format returned by the <a href="#-blankimage">blankimage</a>() method with alpha=False.<br>
# hatchdist - distance from beginning of one vertical hash line to the<br>
# beginning of the next, in pixels.<br>
# hatchthick - thickness in pixels of each vertical hash line.</span></dd></dl>
<dl><dt><a name="-drawhatchrows"><strong>drawhatchrows</strong></a>(image, width, height, hatchdist=8, hatchthick=1, fgcolor=None)</dt><dd><span class="code"># Image has the same format returned by the <a href="#-blankimage">blankimage</a>() method with alpha=False.</span></dd></dl>
<dl><dt><a name="-drawindentborder"><strong>drawindentborder</strong></a>(
helper,
x0,
y0,
x1,
y1,
hilt,
sh,
frame,
outerbordersize=1,
innerbordersize=1
)</dt></dl>
<dl><dt><a name="-drawloweredge"><strong>drawloweredge</strong></a>(helper, x0, y0, x1, y1, lower, edgesize=1, bordersize=1)</dt></dl>
<dl><dt><a name="-drawpositiverect"><strong>drawpositiverect</strong></a>(helper, x0, y0, x1, y1, face)</dt></dl>
<dl><dt><a name="-drawraisedborderbotdom"><strong>drawraisedborderbotdom</strong></a>(helper, x0, y0, x1, y1, hilt, lt, sh, dksh, bordersize=1)</dt><dd><span class="code"># Raised border where the "lower right dominates"</span></dd></dl>
<dl><dt><a name="-drawraisedbordernodom"><strong>drawraisedbordernodom</strong></a>(helper, x0, y0, x1, y1, hilt, lt, sh, dksh, bordersize=1)</dt><dd><span class="code"># Raised border where neither edge "dominates"</span></dd></dl>
<dl><dt><a name="-drawraisedbordertopdom"><strong>drawraisedbordertopdom</strong></a>(helper, x0, y0, x1, y1, hilt, lt, sh, dksh, bordersize=1)</dt><dd><span class="code"># Raised border where the "upper left dominates"</span></dd></dl>
<dl><dt><a name="-drawraisedinnerwindow"><strong>drawraisedinnerwindow</strong></a>(helper, x0, y0, x1, y1, hilt, lt, sh, dksh)</dt><dd><span class="code"># Draw an inner window edge in raised style.</span></dd></dl>
<dl><dt><a name="-drawraisedinnerwindowbutton"><strong>drawraisedinnerwindowbutton</strong></a>(helper, x0, y0, x1, y1, hilt, lt, sh, dksh)</dt><dd><span class="code"># Draw an inner button edge (or "soft" edge) in raised style.</span></dd></dl>
<dl><dt><a name="-drawraisedouterwindow"><strong>drawraisedouterwindow</strong></a>(helper, x0, y0, x1, y1, hilt, lt, sh, dksh)</dt><dd><span class="code"># Draw an outer window edge in raised style.</span></dd></dl>
<dl><dt><a name="-drawraisedouterwindowbutton"><strong>drawraisedouterwindowbutton</strong></a>(helper, x0, y0, x1, y1, hilt, lt, sh, dksh)</dt><dd><span class="code"># Draw an outer button edge (or "soft" edge) in raised style.</span></dd></dl>
<dl><dt><a name="-drawroundededge"><strong>drawroundededge</strong></a>(helper, x0, y0, x1, y1, upper, lower, edgesize=1, bordersize=1)</dt><dd><span class="code"># helper for edge drawing (upper left edge "dominates")</span></dd></dl>
<dl><dt><a name="-drawsunkenborderbotdom"><strong>drawsunkenborderbotdom</strong></a>(helper, x0, y0, x1, y1, hilt, lt, sh, dksh, bordersize=1)</dt><dd><span class="code"># Sunken border where the "lower right dominates"</span></dd></dl>
<dl><dt><a name="-drawsunkenbordernodom"><strong>drawsunkenbordernodom</strong></a>(helper, x0, y0, x1, y1, hilt, lt, sh, dksh, bordersize=1)</dt><dd><span class="code"># Sunken border where neither edge "dominates"</span></dd></dl>
<dl><dt><a name="-drawsunkenbordertopdom"><strong>drawsunkenbordertopdom</strong></a>(helper, x0, y0, x1, y1, hilt, lt, sh, dksh, bordersize=1)</dt><dd><span class="code"># Sunken border where the "upper left dominates"</span></dd></dl>
<dl><dt><a name="-drawsunkeninnerwindow"><strong>drawsunkeninnerwindow</strong></a>(helper, x0, y0, x1, y1, hilt, lt, sh, dksh)</dt><dd><span class="code"># Draw an outer window edge in sunken style.</span></dd></dl>
<dl><dt><a name="-drawsunkeninnerwindowbutton"><strong>drawsunkeninnerwindowbutton</strong></a>(helper, x0, y0, x1, y1, hilt, lt, sh, dksh)</dt><dd><span class="code"># Draw an inner button edge (or "soft" edge) in sunken style.</span></dd></dl>
<dl><dt><a name="-drawsunkenouterwindow"><strong>drawsunkenouterwindow</strong></a>(helper, x0, y0, x1, y1, hilt, lt, sh, dksh)</dt><dd><span class="code"># Draw an outer window edge in sunken style.</span></dd></dl>
<dl><dt><a name="-drawsunkenouterwindowbutton"><strong>drawsunkenouterwindowbutton</strong></a>(helper, x0, y0, x1, y1, hilt, lt, sh, dksh)</dt><dd><span class="code"># Draw an outer button edge (or "soft" edge) in sunken style.</span></dd></dl>
<dl><dt><a name="-drawupperedge"><strong>drawupperedge</strong></a>(helper, x0, y0, x1, y1, upper, edgesize=1, bordersize=1)</dt></dl>
<dl><dt><a name="-ega8colors"><strong>ega8colors</strong></a>()</dt><dd><span class="code"># 8-color palette where each color opponent is 0 or 255<br>
# Each element in the return value is a color in the form of a 3-element list of its red,<br>
# green, and blue components in that order, where each<br>
# component is an integer from 0 through 255.</span></dd></dl>
<dl><dt><a name="-egacolors"><strong>egacolors</strong></a>()</dt><dd><span class="code"># Returns an array of the 64 colors displayable by EGA (extended graphics adapter) displays<br>
# Each element in the return value is a color in the form of a 3-element list of its red,<br>
# green, and blue components in that order, where each<br>
# component is an integer from 0 through 255.</span></dd></dl>
<dl><dt><a name="-eightColorDither"><strong>eightColorDither</strong></a>(image, width, height, alpha=False)</dt><dd><span class="code"># Dithers in place the specified image to the colors in an 8-bit color palette returned by <a href="#-ega8colors">ega8colors</a>().<br>
# Image has the same format returned by the <a href="#-blankimage">blankimage</a>() method with the specified value of 'alpha' (default value for 'alpha' is False).</span></dd></dl>
<dl><dt><a name="-emboss"><strong>emboss</strong></a>(bgColor=None, fgColor=None, hiltColor=None)</dt><dd><span class="code"># ImageMagick command to emboss an input image described in 'versatilePattern' into a 3-color (black/gray/white) image.<br>
# If 'fgColor' is lighter than 'hiltColor' (as is the default), then embossing an outline will result in its<br>
# appearing raised above the background, given the existence of a light source that shines from the upper<br>
# lower-left corner.<br>
# If 'fgColor' is darker than 'hiltColor', the outline instead appears engraved, that is, sunken into the<br>
# background, given the light source just described.<br>
# In this description, lower-intensity values are generally "darker", higher-intensity values "lighter".</span></dd></dl>
<dl><dt><a name="-endingColumnsAreMirrored"><strong>endingColumnsAreMirrored</strong></a>(image, width, height)</dt><dd><span class="code"># Returns True if width or height is 0 or if:<br>
# - The image's first column's first half is a mirror<br>
# of its second half, and...<br>
# - The image's last column's first half is a mirror<br>
# of its second half.<br>
# Image has the same format returned by the <a href="#-blankimage">blankimage</a>() method with alpha=False.</span></dd></dl>
<dl><dt><a name="-endingRowsAreMirrored"><strong>endingRowsAreMirrored</strong></a>(image, width, height)</dt><dd><span class="code"># Returns True if width or height is 0 or if:<br>
# - The image's first row's first half is a mirror<br>
# of its second half, and...<br>
# - The image's last row's first half is a mirror<br>
# of its second half.<br>
# Image has the same format returned by the <a href="#-blankimage">blankimage</a>() method with alpha=False.</span></dd></dl>
<dl><dt><a name="-fieldbox"><strong>fieldbox</strong></a>(helper, x0, y0, x1, y1, hilt, lt, sh, dksh, face=None, pressed=False)</dt></dl>
<dl><dt><a name="-flatborder"><strong>flatborder</strong></a>(helper, x0, y0, x1, y1, sh, buttonFace)</dt></dl>
<dl><dt><a name="-floydSteinbergDither"><strong>floydSteinbergDither</strong></a>(image, width, height, palette, alpha=False)</dt><dd><span class="code"># Same as <a href="#-patternDither">patternDither</a>(), but uses the Floyd-Steinberg algorithm.<br>
# There is no 'fast' parameter.</span></dd></dl>
<dl><dt><a name="-getgrays"><strong>getgrays</strong></a>(palette)</dt><dd><span class="code"># Finds the gray tones in the specified color palette and returns<br>
# a sorted list of them (as a list of integers, not three-element<br>
# lists).</span></dd></dl>
<dl><dt><a name="-getpixel"><strong>getpixel</strong></a>(image, width, height, x, y)</dt><dd><span class="code"># Image has the same format returned by the <a href="#-blankimage">blankimage</a>() method with alpha=False.<br>
# Returns a list describing a color; its elements are the red, green, and blue<br>
# components, in that order.</span></dd></dl>
<dl><dt><a name="-getpixelalpha"><strong>getpixelalpha</strong></a>(image, width, height, x, y)</dt><dd><span class="code"># Image has the same format returned by the <a href="#-blankimage">blankimage</a>() method with alpha=True.<br>
# Returns a list describing a color; its elements are the red, green, blue, and<br>
# alpha components, in that order.</span></dd></dl>
<dl><dt><a name="-getpixelbgr"><strong>getpixelbgr</strong></a>(image, width, height, x, y)</dt><dd><span class="code"># Image has the same format returned by the <a href="#-blankimage">blankimage</a>() method with alpha=False.<br>
# Returns a list describing a color; its elements are the blue, green, and red<br>
# components, in that order.</span></dd></dl>
<dl><dt><a name="-getpixelbgralpha"><strong>getpixelbgralpha</strong></a>(image, width, height, x, y)</dt><dd><span class="code"># Image has the same format returned by the <a href="#-blankimage">blankimage</a>() method with alpha=False.<br>
# Returns a list describing a color; its elements are the blue, green, red, and alpha<br>
# components, in that order.</span></dd></dl>
<dl><dt><a name="-graymap"><strong>graymap</strong></a>(image, width, height, colors=None, alpha=False, ignoreNonGrays=False)</dt><dd><span class="code"># Converts the image to grayscale and maps the resulting gray tones<br>
# to colors in the specified colors array. If 'colors' is None (the default),<br>
# the mapping step is skipped.<br>
# Image has the same format returned by the <a href="#-blankimage">blankimage</a>() method with the specified value of 'alpha' (default value for 'alpha' is False).<br>
# If 'ignoreNonGrays' is True, leave colors other than gray tones<br>
# in the image unchanged. Default is False.</span></dd></dl>
<dl><dt><a name="-groupCmm"><strong>groupCmm</strong></a>()</dt><dd><span class="code"># ImageMagick command to generate a Cmm wallpaper group tiling pattern.<br>
# For best results, the command should be applied to images whose<br>
# last row's and last column's first half is a mirror of its<br>
# second half.</span></dd></dl>
<dl><dt><a name="-groupP2"><strong>groupP2</strong></a>()</dt><dd><span class="code"># ImageMagick command to generate a P2 wallpaper group tiling pattern.<br>
# For best results, the command should be applied to images whose<br>
# last row's first half is a mirror of its second half.</span></dd></dl>
<dl><dt><a name="-groupPg"><strong>groupPg</strong></a>()</dt><dd><span class="code"># ImageMagick command to generate a Pg wallpaper group tiling pattern.<br>
# For best results, the command should be applied to images whose<br>
# last column's first half is a mirror of its second half.</span></dd></dl>
<dl><dt><a name="-groupPgImage"><strong>groupPgImage</strong></a>(img, width, height, alpha=False)</dt><dd><span class="code"># Generate a Pg wallpaper group tiling pattern from a tileable image.<br>
# For best results, the command should be applied to images whose<br>
# last column's first half is a mirror of its second half.<br>
# Returns a three-element list with the new image, its width, and its height.<br>
# The input image and the returned image have the same format returned by the <a href="#-blankimage">blankimage</a>() method with<br>
# the specified value of 'alpha' (the default value for 'alpha' is False).</span></dd></dl>
<dl><dt><a name="-groupPgg"><strong>groupPgg</strong></a>()</dt><dd><span class="code"># ImageMagick command to generate a Pgg wallpaper group tiling pattern.<br>
# For best results, the command should be applied to images whose<br>
# last row's and last column's first half is a mirror of its<br>
# second half.</span></dd></dl>
<dl><dt><a name="-groupPm"><strong>groupPm</strong></a>()</dt><dd><span class="code"># ImageMagick command to generate a Pm wallpaper group tiling pattern.<br>
# For best results, the command should be applied to images whose<br>
# last row's first half is a mirror of its second half.</span></dd></dl>
<dl><dt><a name="-groupPmImage"><strong>groupPmImage</strong></a>(img, width, height, alpha=False)</dt><dd><span class="code"># Generate a Pm wallpaper group tiling pattern from a tileable image.<br>
# For best results, the command should be applied to images whose<br>
# last row's first half is a mirror of its second half.<br>
# Returns a three-element list with the new image, its width, and its height.<br>
# The input image and the returned image have the same format returned by the <a href="#-blankimage">blankimage</a>() method with<br>
# the specified value of 'alpha' (the default value for 'alpha' is False).</span></dd></dl>
<dl><dt><a name="-groupPmg"><strong>groupPmg</strong></a>()</dt><dd><span class="code"># ImageMagick command to generate a Pmg wallpaper group tiling pattern.<br>
# For best results, the command should be applied to images whose<br>
# last column's first half is a mirror of its<br>
# second half.</span></dd></dl>
<dl><dt><a name="-groupingbox"><strong>groupingbox</strong></a>(helper, x0, y0, x1, y1, hilt, lt, sh, dksh, face=None)</dt></dl>
<dl><dt><a name="-halfhalfditherimage"><strong>halfhalfditherimage</strong></a>(image, width, height, palette)</dt></dl>
<dl><dt><a name="-hatchedbox"><strong>hatchedbox</strong></a>(
image,
width,
height,
color,
pattern,
x0,
y0,
x1,
y1,
msbfirst=True,
drawborder=False,
wraparound=True
)</dt><dd><span class="code"># Draw a wraparound hatched box on an image.<br>
# Image has the same format returned by the <a href="#-blankimage">blankimage</a>() method with alpha=False.<br>
# 'color' is the color of the hatch, drawn on every "black" pixel (defined below)<br>
# in the pattern's tiling.<br>
# 'pattern' is an 8-element array with integers in the interval [0,255].<br>
# The first integer represents the first row from the top;<br>
# the second, the second row, etc.<br>
# For each integer, the eight bits from most to least significant represent<br>
# the column from left to right (right to left if 'msbfirst' is False).<br>
# If a bit is set, the corresponding position<br>
# in the pattern is a "black" pixel; if clear, a "white" pixel.<br>
# Either can be set to None to omit pixels of that color in the pattern<br>
# 'msbfirst' is the bit order for each integer in 'pattern'. If True,<br>
# the Windows convention is used; if False, the X pixmap convention is used.<br>
# Default is True.<br>
# 'drawborder' means to draw the box's border with the hatch color;<br>
# default is False.</span></dd></dl>
<dl><dt><a name="-hautrelief"><strong>hautrelief</strong></a>(bg=[192, 192, 192], highlight=[255, 255, 255], shadow=[0, 0, 0])</dt><dd><span class="code"># ImageMagick command.</span></dd></dl>
<dl><dt><a name="-horizhatchedbox"><strong>horizhatchedbox</strong></a>(image, width, height, color, x0, y0, x1, y1)</dt><dd><span class="code"># Draws a box filled with a transparent horizontal hatch pattern.<br>
# Image has the same format returned by the <a href="#-blankimage">blankimage</a>() method with alpha=False.</span></dd></dl>
<dl><dt><a name="-horizskew"><strong>horizskew</strong></a>(image, width, height, skew, alpha=False)</dt><dd><span class="code"># Image has the same format returned by the <a href="#-blankimage">blankimage</a>() method with the<br>
# given value of 'alpha' (default value for 'alpha' is False).</span></dd></dl>
<dl><dt><a name="-imageblit"><strong>imageblit</strong></a>(
dstimage,
dstwidth,
dstheight,
x0,
y0,
srcimage,
srcwidth,
srcheight,
wraparound=True,
alpha=False
)</dt><dd><span class="code"># 'dstimage' and 'srcimage' have the same format returned by the <a href="#-blankimage">blankimage</a>() method with<br>
# the specified value of 'alpha' (the default value for 'alpha' is False).</span></dd></dl>
<dl><dt><a name="-imageblitex"><strong>imageblitex</strong></a>(
dstimage,
dstwidth,
dstheight,
x0,
y0,
x1,
y1,
srcimage,
srcwidth,
srcheight,
x0src=0,
y0src=0,
patternimage=None,
patternwidth=0,
patternheight=0,
patternOrgX=0,
patternOrgY=0,
maskimage=None,
maskwidth=0,
maskheight=0,
x0mask=0,
y0mask=0,
ropForeground=204,
ropBackground=170,
wraparound=True,
alpha=False
)</dt><dd><span class="code"># Draw a wraparound copy of an image on another image.<br>
# 'dstimage' and 'srcimage' are the destination and source images.<br>
# 'pattern' is a brush pattern image (also known as a stipple).<br>
# 'srcimage', 'maskimage', and 'patternimage' are optional.<br>
# 'dstimage', 'srcimage', 'patternimage', and 'maskimage', to the extent given,<br>
# have the same format returned by the <a href="#-blankimage">blankimage</a>() method with the specified value of 'alpha'.<br>
# The default value for 'alpha' is False, and the alpha channel<br>
# (opacity channel) of the images, if any, is<br>
# subject to the image operation in the same way as the red, green, and blue channels.<br>
# (Windows's graphical device interface [GDI] supports transparent<br>
# pixels in brush patterns, but only for brushes<br>
# with predefined hatch patterns and only in the gaps between hatch marks; in<br>
# bit block transfer operations such as BitBlt, these transparent pixels are<br>
# filled with the background color whether the background mode is<br>
# transparent or opaque; in line and shape drawing operations (which this<br>
# method doesn't belong in), if the background mode is transparent, only<br>
# the nontransparent pixels are drawn and affected by raster operations.)<br>
# 'patternOrgX' and 'patternOrgY' are offsets from the destination's upper left<br>
# corner where the upper-left corner of the brush pattern image would<br>
# be drawn if a repetition of the brush pattern were to be drawn across the<br>
# whole destination image. The default for both parameters is 0.<br>
# 'x0src' and 'y0src' are offsets from the destination image's upper-left corner<br>
# where the source image's upper-left corner will be drawn.<br>
# 'x0mask' and 'y0mask' are offsets from the source image's upper-left corner<br>
# and correspond to pixels in the source image.<br>
#<br>
# 'ropForeground' is a foreground ternary raster operation between the bits of the<br>
# destination, those of the source, and those of the brush pattern; the low 4<br>
# bits give the binary raster<br>
# operation used where the pattern bit is 0 or there is no pattern or an empty pattern;<br>
# the high 4 bits, where the pattern<br>
# bit is 1. 'ropForeground' is used where the mask bit is 1 or there is no mask<br>
# or an empty mask. 'ropBackground' is the same as 'ropForeground', but for the<br>
# background (used where the mask bit is 0 rather than 1).<br>
# In turn, a binary raster operation is a 4-bit value that tells how to combine<br>
# the bits of the destination with those of the source; the low 2 bits give the unary<br>
# raster operation used where the source bit is 0 or there is no source or an empty<br>
# source; the high 2 bits, where the source<br>
# bit is 1. In turn, a unary raster operation tells how to change each bit<br>
# of the destination: if the operation is 0, the result is 0; if 1, the destination<br>
# bit is inverted (the result is 1 if the destination bit is 0, and vice versa);<br>
# if 2, the result is the destination bit (the destination is left unchanged);<br>
# if 3, the result is 1. For example, suppose the source and<br>
# destination images are black-and-white (where 0-bits represent black, and 1-bits white), and<br>
# suppose the binary raster operation is 6 (or the ternary raster operation is 0x66).<br>
# Then, where the source is white (source bit is 1), the destination color is inverted<br>
# (since the high 2 bits give 1), and where the source is black (source bit is 0), the<br>
# destination is left unchanged (since the low 2 bits give 2).<br>
# The default for 'ropForeground' is 0xCC (copy the source to the destination), and the<br>
# default for 'ropBackground' is 0xAA (leave destination unchanged).<br>
#<br>
# The following are commonly seen ternary raster operations:<br>
# 0x00: Turn destination "black" (bits are all zeros).<br>
# 0x11: "Not source erase", "not merge pen" ("pen" is understood as the source pixel).<br>
# 0x22: "Mask not pen".<br>
# 0x33: "Not source copy", "not copy pen".<br>
# 0x44: "Source erase", "mask pen not".<br>
# 0x55: "Destination invert".<br>
# 0x66: "Source invert", "XOR pen".<br>
# 0x77: "Not mask pen".<br>
# 0x88: "Source AND".<br>
# 0x99: "Not XOR pen".<br>
# 0xAA: "No-op"; destination is left unchanged.<br>
# 0xBB: "Merge paint", "merge not pen".<br>
# 0xCC: "Source copy"; copy source to destination.<br>
# 0xDD: "Merge pen not".<br>
# 0xEE: "Source paint"; "merge pen not".<br>
# 0xFF: Turn destination "white" (bits are all ones).<br>
# 0x5A: Pattern invert.<br>
# 0xC0: "Merge copy"; where pattern pixel's bits are all ones, copy the source to the<br>
# destination; where pattern pixel's bits are all zeros, set the destination<br>
# pixel's bits to all zeros.<br>
# 0xF0: Pattern copy.<br>
# 0xFB: "Pattern paint".<br>
#<br>
# 'maskimage' is ideally a two-level image in which every pixel's bits are either all zeros<br>
# (black) or all ones (white), but it doesn't have to be.<br>
# 'dstimage' may be the same as 'srcimage', 'patternimage', or 'maskimage',<br>
# and the source and destination rectangles may overlap.</span></dd></dl>
<dl><dt><a name="-imagecomposite"><strong>imagecomposite</strong></a>(
dstimage,
dstwidth,
dstheight,
x0,
y0,
x1,
y1,
srcimage,
srcwidth,
srcheight,
x0src=0,
y0src=0,
porterDuffOp=0,
wraparound=True,
alpha=True,
sourceAlpha=255,
screendoor=False
)</dt><dd><span class="code"># Performs an image composition involving a source image and a destination image. The destination rectangle<br>
# begins at x0 and y0 and has width ('x1'-'x0') and height ('y1'-'y0'), and<br>
# wraps around the destination if 'wraparound'<br>
# is True. Unlike with the original Porter&ndash;Duff composition operators, areas of the destination outside<br>
# the destination rectangle are left unchanged.<br>
# 'dstimage' and 'srcimage' have the same format returned by the <a href="#-blankimage">blankimage</a>() method with the specified value of 'alpha'.<br>
# The default value for 'alpha' is True. If 'alpha' is False, this method behaves as though both images<br>
# had an alpha channel with all pixel's alpha components set to 255 (so that the two images are treated as opaque).<br>
# If 'srcimage' is None, a source image with all zeros and an alpha of 0 for all pixels is used as the source, even if<br>
# 'alpha' is False. The red, green, and blue components for each image are assumed to be "nonpremultiplied", that<br>
# is, not multiplied beforehand by the alpha component divided by 255.<br>
# 'porterDuffOp' is one of the following operators: 0 = source over;<br>
# 1 = source in; 2 = source held out; 3 = source atop; 4 = destination over;<br>
# 5 = destination in; 6 = destination held out; 7 = destination atop;<br>
# 8 = copy source; 9 = copy destination; 10 = clear; 11 = XOR; 12 = plus.<br>
# The default value is 0, source over.<br>
# If 'screendoor' is True (default is 'False'), translucency (semitransparency) is simulated<br>
# by scattering transparent and opaque pixels, or dithering (a process also known as stippled<br>
# or screen-door transparency).<br>
#<br>
# Blending Note: Operations that involve the blending of two RGB (red-green-<br>
# blue) colors work best if the RGB color space is linear. This is not the case<br>
# for the sRGB color space, which is the color space assumed for images created<br>
# using the <a href="#-blankimage">blankimage</a>() method. Moreover, converting an image from a nonlinear<br>
# to a linear color space and back can lead to data loss especially if the image's color<br>
# components are 8 bits or fewer in length (as with images returned by <a href="#-blankimage">blankimage</a>()).<br>
# This function does not do any such conversion. The Blending Note does not<br>
# apply to this function if 'screendoor' is True or if both 'sourceAlpha' is 0 or 255 and<br>
# the input images have only transparent and<br>
# opaque pixels (the alpha component of each color is either 0 or 255); in that case,<br>
# the images can be in a linear or nonlinear RGB color space.</span></dd></dl>
<dl><dt><a name="-imagept"><strong>imagept</strong></a>(image, width, height, x, y, alpha=False, wraparound=True)</dt><dd><span class="code"># Gets the color of the in-between pixel at the specified point<br>
# of the image, using bilinear interpolation.<br>
# 'image' has the same format returned by the <a href="#-blankimage">blankimage</a>() method with the specified value of 'alpha'.<br>
# The default value for 'alpha' is True.<br>
# 'width' and 'height' is the image's width and height.<br>
# 'x' is the point's x-coordinate, which need not be an integer.<br>
# 'y' is the point's y-coordinate, which need not be an integer.<br>
# If 'wraparound' is True (the default), an out-of-bounds point ('x','y') will<br>
# undergo a wraparound adjustment, as though the specified image were part<br>
# of an "infinite" tiling. If False, an out-of-bounds point is adjusted to<br>
# lie in the image (0<=x<='width'-1; 0<=y<='height'-1).<br>
#<br>
# Blending Note: Operations that involve the blending of two RGB (red-green-<br>
# blue) colors work best if the RGB color space is linear. This is not the case<br>
# for the sRGB color space, which is the color space assumed for images created<br>
# using the <a href="#-blankimage">blankimage</a>() method. Moreover, converting an image from a nonlinear<br>
# to a linear color space and back can lead to data loss especially if the image's color<br>
# components are 8 bits or fewer in length (as with images returned by <a href="#-blankimage">blankimage</a>()).<br>
# This function does not do any such conversion.</span></dd></dl>
<dl><dt><a name="-imagereversecolumnorder"><strong>imagereversecolumnorder</strong></a>(image, width, height, alpha=False)</dt><dd><span class="code"># Reverses in place the order of columns in the specified image. Returns 'image'.<br>
# Image has the same format returned by the <a href="#-blankimage">blankimage</a>() method with<br>
# the specified value of 'alpha' (the default value for 'alpha' is False).</span></dd></dl>
<dl><dt><a name="-imagereverseroworder"><strong>imagereverseroworder</strong></a>(image, width, height, alpha=False)</dt><dd><span class="code"># Reverses in place the order of rows in the specified image. Returns 'image'.<br>
# Image has the same format returned by the <a href="#-blankimage">blankimage</a>() method with<br>
# the specified value of 'alpha' (the default value for 'alpha' is False).</span></dd></dl>
<dl><dt><a name="-imagerotatecolumn"><strong>imagerotatecolumn</strong></a>(image, width, height, x, offset=0, alpha=False)</dt><dd><span class="code"># Rotates in place a column of the image by the specified downward offset in pixels,<br>
# which may be negative or not.<br>
# Image has the same format returned by the <a href="#-blankimage">blankimage</a>() method with<br>
# the specified value of 'alpha' (the default value for 'alpha' is False).</span></dd></dl>
<dl><dt><a name="-imagerotaterow"><strong>imagerotaterow</strong></a>(image, width, height, y, offset=0, alpha=False)</dt><dd><span class="code"># Rotates in place a row of the image by the specified rightward offset in pixels,<br>
# which may be negative or not.<br>
# Image has the same format returned by the <a href="#-blankimage">blankimage</a>() method with<br>
# the specified value of 'alpha' (the default value for 'alpha' is False).</span></dd></dl>
<dl><dt><a name="-imageshear"><strong>imageshear</strong></a>(
img,
width,
height,
newwidth=None,
newheight=None,
alpha=False,
upward=True,
smoothing=True
)</dt><dd><span class="code"># Generates a sheared image, with optional resizing.<br>
# 'newwidth' is the new width of the image in pixels. If not given, same as 'width'.<br>
# 'newheight' is the new height of the image in pixels. If not given, same as 'height'.<br>
# If upward=True (the default), the shear is upward and only the left and right edges<br>
# of the input image must be tileable; the upper and lower edges need not be.<br>
# If upward=False, the shear is rightward and only the upper and lowe edges<br>
# of the input image must be tileable.<br>
# Input and output images have the same format returned by the <a href="#-blankimage">blankimage</a>() method with the<br>
# given value of 'alpha' (default value for 'alpha' is False).</span></dd></dl>
<dl><dt><a name="-imagesrcover"><strong>imagesrcover</strong></a>(
dstimage,
dstwidth,
dstheight,
x0,
y0,
x1,
y1,
srcimage,
srcwidth,
srcheight,
x0src=0,
y0src=0,
wraparound=True,
sourceAlpha=255,
screendoor=False
)</dt><dd><span class="code"># Performs a source-over composition involving a source image with an alpha channel<br>
# and a destination image without an alpha channel. The destination rectangle<br>
# begins at x0 and y0 and has width ('x1'-'x0') and height ('y1'-'y0'),<br>
# and wraps around the destination if 'wraparound'<br>
# is True.<br>
# 'dstimage' has the same format returned by the <a href="#-blankimage">blankimage</a>() method with alpha=False; 'srcimage', with alpha=True.<br>
# If 'srcimage' is None, a source image with all zeros and an alpha of 0 for all pixels is used as the source, even if<br>
# 'alpha' is False. The red, green, and blue components for 'srcimage' are assumed to be "nonpremultiplied", that<br>
# is, not multiplied beforehand by the alpha component divided by 255.<br>
# If 'screendoor' is True (default is 'False'), translucency (semitransparency) is<br>
# simulated by scattering transparent and opaque pixels, or dithering (a process also known<br>
# as stippled or screen-door transparency).<br>
#<br>
# Blending Note: Operations that involve the blending of two RGB (red-green-<br>
# blue) colors work best if the RGB color space is linear. This is not the case<br>
# for the sRGB color space, which is the color space assumed for images created<br>
# using the <a href="#-blankimage">blankimage</a>() method. Moreover, converting an image from a nonlinear<br>
# to a linear color space and back can lead to data loss especially if the image's color<br>
# components are 8 bits or fewer in length (as with images returned by <a href="#-blankimage">blankimage</a>()).<br>
# This function does not do any such conversion. The Blending Note does not<br>
# apply to this function if 'screendoor' is True or if both 'sourceAlpha' is 0 or 255 and<br>
# the input images have only transparent and<br>
# opaque pixels (the alpha component of each color is either 0 or 255); in that case,<br>
# the images can be in a linear or nonlinear RGB color space.</span></dd></dl>
<dl><dt><a name="-imagetransblit"><strong>imagetransblit</strong></a>(
dstimage,
dstwidth,
dstheight,
x0,
y0,
x1,
y1,
srcimage,
srcwidth,
srcheight,
x0src=0,
y0src=0,
transcolor=None,
patternimage=None,
patternwidth=0,
patternheight=0,
patternOrgX=0,
patternOrgY=0,
ropForeground=204,
ropBackground=170,
wraparound=True,
alpha=False
)</dt><dd><span class="code"># All images have the same format returned by the <a href="#-blankimage">blankimage</a>() method with the specified value of 'alpha'.<br>
# The default value for 'alpha' is False, and the alpha channel (opacity channel) of the images, if any, is<br>
# subject to the image operation in the same way as the red, green, and blue channels.<br>
# 'ropForeground' and 'ropBackground' are as in <a href="#-imageblitex">imageblitex</a>(), except that<br>
# 'ropForeground' is used where the source color is not 'transcolor' or if<br>
# 'transcolor' is None (in this sense, if 'transcolor' has three elements and 'alpha' is True,<br>
# the fourth element, the alpha component, is treated as 255 so that 'transcolor' is an opaque<br>
# color); 'ropBackground' is used elsewhere.<br>
# The default for 'ropForeground' is 0xCC (copy the source to the destination), and the<br>
# default for 'ropBackground' is 0xAA (leave destination unchanged).<br>
# For more on raster operations, see the documentation for 'imageblitex'.<br>
# 'dstimage' may be the same as 'srcimage' or 'patternimage',<br>
# and the source and destination rectangles may overlap.</span></dd></dl>
<dl><dt><a name="-imagetranspose"><strong>imagetranspose</strong></a>(image, width, height, alpha=False)</dt><dd><span class="code"># Image has the same format returned by the <a href="#-blankimage">blankimage</a>() method with the specified value of 'alpha' (default value for 'alpha' is False).</span></dd></dl>
<dl><dt><a name="-interlace"><strong>interlace</strong></a>(image, width, height, alpha=False)</dt><dd><span class="code"># Split an image into two interlaced versions with half the height.<br>
# Image has the same format returned by the <a href="#-blankimage">blankimage</a>() method with the specified value of 'alpha' (default value for 'alpha' is False).<br>
# The first image should be displayed at even-numbered frames; the second,<br>
# odd-numbered.</span></dd></dl>
<dl><dt><a name="-lightmodePattern"><strong>lightmodePattern</strong></a>()</dt><dd><span class="code"># ImageMagick command for setting a light gray (192,192,192) foreground pattern on a white (255,255,255) background.</span></dd></dl>
<dl><dt><a name="-linedraw"><strong>linedraw</strong></a>(
image,
width,
height,
c,
x0,
y0,
x1,
y1,
drawEndPoint=False,
wraparound=True,
alpha=False
)</dt><dd><span class="code"># Draws a line that optionally wraps around.<br>
# Image has the same format returned by the <a href="#-blankimage">blankimage</a>() method with<br>
# the specified value of 'alpha' (the default value for 'alpha' is False).</span></dd></dl>
<dl><dt><a name="-magickgradientditherfilter"><strong>magickgradientditherfilter</strong></a>(
rgb1=None,
rgb2=None,
basecolors=None,
hue=0,
dither=True
)</dt><dd><span class="code"># Returns an ImageMagick filter string to generate a desktop background from an image, in three steps.<br>
# 1. If rgb1 and rgb2 are not nil, converts the input image to grayscale, then translates the grayscale<br>
# palette to a gradient starting at rgb1 for grayscale level 0 (a 3-element list of the red,<br>
# green, and blue components in that order; for example, [2,10,255] where each<br>
# component is from 0 through 255) and ending at rgb2 for grayscale level 255 (same format as rgb1).<br>
# Raises an error if rgb1 or rgb2 has a length less than 3.<br>
# The output image is the input for the next step.<br>
# 2. If hue is not 0, performs a hue shift, in degrees (-180 to 180), of the input image.<br>
# The output image is the input for the next step.<br>
# 3. If basecolors is not nil, ensures that that the image used only the colors<br>
# given in 'basecolors', which is a list<br>
# of colors (each color is of the same format as rgb1 and rgb2). If 'dither' is also True, the<br>
# image's colors are then scattered so that they appear close to the original colors.<br>
# Raises an error if 'basecolors' has a length greater than 256.</span></dd></dl>
<dl><dt><a name="-magickgradientditherfilterrandom"><strong>magickgradientditherfilterrandom</strong></a>()</dt><dd><span class="code"># ImageMagick command.</span></dd></dl>
<dl><dt><a name="-maketileable"><strong>maketileable</strong></a>(image, width, height, alpha=False)</dt><dd><span class="code"># Makes a tileable image from a not necessarily tileable image, by blending<br>
# the image's edge with its middle.<br>
# Image has the same format returned by the <a href="#-blankimage">blankimage</a>() method<br>
# with the specified value of 'alpha' (default value for 'alpha' is False).<br>
#<br>
# Blending Note: Operations that involve the blending of two RGB (red-green-<br>
# blue) colors work best if the RGB color space is linear. This is not the case<br>
# for the sRGB color space, which is the color space assumed for images created<br>
# using the <a href="#-blankimage">blankimage</a>() method. Moreover, converting an image from a nonlinear<br>
# to a linear color space and back can lead to data loss especially if the image's color<br>
# components are 8 bits or fewer in length (as with images returned by <a href="#-blankimage">blankimage</a>()).<br>
# This function does not do any such conversion.</span></dd></dl>
<dl><dt><a name="-monoborder"><strong>monoborder</strong></a>(helper, x0, y0, x1, y1, clientAreaColor, windowFrameColor)</dt></dl>
<dl><dt><a name="-monochromeFromThreeGrays"><strong>monochromeFromThreeGrays</strong></a>(image, width, height)</dt><dd><span class="code"># Input image uses only three colors: (0,0,0) or black,(128,128,128),(255,255,255) or white<br>
# Turns the image into a black-and-white image, with middle gray dithered.<br>
# Image has the same format returned by the <a href="#-blankimage">blankimage</a>() method with alpha=False.</span></dd></dl>
<dl><dt><a name="-noalpha"><strong>noalpha</strong></a>(image, width, height)</dt><dd><span class="code"># Converts an image with an alpha channel to an image without an alpha channel by<br>
# removing that alpha channel.<br>
# The input image has the same format returned by the <a href="#-blankimage">blankimage</a>() method with alpha=True.<br>
# The output image has the same format returned by the <a href="#-blankimage">blankimage</a>() method with alpha=False.</span></dd></dl>
<dl><dt><a name="-noiseimage"><strong>noiseimage</strong></a>(width=64, height=64)</dt><dd><span class="code"># Returns an image with the same format returned by the <a href="#-blankimage">blankimage</a>() method with alpha=False.</span></dd></dl>