11# Import local modules
22from photoshop .api ._core import Photoshop
3+ from photoshop .api .enumerations import ColorReductionType
4+ from photoshop .api .enumerations import DitherType
35
46
57class ExportOptionsSaveForWeb (Photoshop ):
68 """Options for exporting Save For Web files."""
79
8- object_name = " ExportOptionsSaveForWeb"
10+ object_name = ' ExportOptionsSaveForWeb'
911
1012 def __init__ (self ):
1113 super ().__init__ ()
1214 self .format = 13 # PNG
1315 self .PNG8 = False # Sets it to PNG-24 bit
1416
1517 @property
16- def PNG8 (self ):
18+ def PNG8 (self ) -> bool :
1719 """If true, uses 8 bits. If false, uses 24 bits. Valid only when ‘format’ = PNG."""
1820 return self .app .PNG8
1921
@@ -22,41 +24,44 @@ def PNG8(self, value: bool):
2224 self .app .PNG8 = value
2325
2426 @property
25- def blur (self ):
27+ def blur (self ) -> float :
28+ """Applies blur to the image to reduce artifacts."""
2629 return self .app .blur
2730
2831 @blur .setter
29- def blur (self , value ):
32+ def blur (self , value : float ):
3033 self .app .blur = value
3134
3235 @property
33- def colorReduction (self ):
36+ def colorReduction (self ) -> ColorReductionType :
37+ """The color reduction algorithm."""
3438 return self .app .colorReduction
3539
3640 @colorReduction .setter
37- def colorReduction (self , value ):
41+ def colorReduction (self , value : ColorReductionType ):
3842 self .app .colorReduction = value
3943
4044 @property
41- def colors (self ):
45+ def colors (self ) -> int :
4246 """The number of colors in the palette."""
4347 return self .app .colors
4448
4549 @colors .setter
46- def colors (self , value ):
47- """The number of colors in the palette."""
50+ def colors (self , value : int ):
4851 self .app .colors = value
4952
5053 @property
51- def dither (self ):
54+ def dither (self ) -> DitherType :
55+ """The type of dither to use."""
5256 return self .app .dither
5357
5458 @dither .setter
55- def dither (self , value ):
59+ def dither (self , value : DitherType ):
5660 self .app .dither = value
5761
5862 @property
59- def quality (self ):
63+ def quality (self ) -> int :
64+ """The quality of the output image, from 0 to 100."""
6065 return self .app .quality
6166
6267 @quality .setter
@@ -65,12 +70,14 @@ def quality(self, value: int):
6570
6671
6772class PNGSaveOptions (Photoshop ):
68- object_name = "PNGSaveOptions "
73+ """Options for saving file as PNG."" "
6974
70- def __init__ (self ):
75+ object_name = 'PNGSaveOptions'
76+
77+ def __init__ (self , interlaced : bool = False , compression : int = 6 ):
7178 super ().__init__ ()
72- self .interlaced = False
73- self .compression = 6
79+ self .interlaced = interlaced
80+ self .compression = compression
7481
7582 @property
7683 def interlaced (self ) -> bool :
0 commit comments