compress_image method
compress_image
Compresses the image by reducing its size based on the shape size and specified resolution. Optionally, it also deletes cropped areas.
Returns
A bool indicating whether the image was successfully compressed. Returns True if the image was resized or cropped, otherwise False.
def compress_image(self, delete_cropped_areas_of_image, resolution):
...
Parameter | Type | Description |
---|---|---|
delete_cropped_areas_of_image | bool | If true, the method will remove the cropped areas of the image, potentially further reducing its size. |
resolution | float | The target resolution in DPI. This value must be positive and defines how the image will be resized. |
Remarks
This method changes the image’s size and resolution similar to PowerPoint’s “Picture Format -> Compress Pictures” feature.
Exceptions
Exception | Description |
---|---|
RuntimeError(Proxy error(ArgumentException)) | Thrown when the resolution is not a positive value. |
See Also
- class
PictureFillFormat
- module
aspose.slides
- library
Aspose.Slides