Skip to content

Commit 1b7dd1d

Browse files
author
Evgeniy Sidenko
committed
Release Aspose.Imaging for Python via .NET 25.3
1 parent caf26dc commit 1b7dd1d

File tree

21 files changed

+352
-66
lines changed

21 files changed

+352
-66
lines changed

english/python-net/aspose.imaging.fileformats.cdr.objects/cdrtransforms/_index.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ url: /python-net/aspose.imaging.fileformats.cdr.objects/cdrtransforms/
2323
| disposed | bool | r | Gets a value indicating whether this instance is disposed. |
2424
| document | [CdrDocument](/imaging/python-net/aspose.imaging.fileformats.cdr.objects/cdrdocument) | r/w | Gets or sets the document. |
2525
| parent | [CdrObjectContainer](/imaging/python-net/aspose.imaging.fileformats.cdr.objects/cdrobjectcontainer) | r/w | Gets or sets the parent. |
26-
| transforms | System.Collections.Generic.List<Matrix> | r/w | Gets or sets the transforms. |
26+
| transforms | list[Matrix] | r/w | Gets or sets the transforms. |
2727

2828

2929
### Constructor: CdrTransforms() {#CdrTransforms__1}

english/python-net/aspose.imaging.fileformats.cmx/cmximage/_index.md

Lines changed: 30 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@ url: /python-net/aspose.imaging.fileformats.cmx/cmximage/
3838
| interrupt_monitor | [InterruptMonitor](/imaging/python-net/aspose.imaging.multithreading/interruptmonitor/) | r/w | Gets or sets the interrupt monitor. |
3939
| is_cached | bool | r | Determine whether the object's data is currently cached, eliminating the need<br/> for data reading. Ideal for developers seeking to optimize performance by<br/> leveraging cached data efficiently, ensuring faster access to object information. |
4040
| page_count | int | r | Retrieve the total page count of the image with this intuitive property.<br/> Ideal for developers seeking to manage multi-page images dynamically,<br/> ensuring efficient navigation and manipulation of image content. |
41-
| pages | [Image[]](/imaging/python-net/aspose.imaging/image) | r | Retrieve the pages of the image seamlessly with this intuitive property.<br/> Ideal for developers seeking to access and manipulate individual pages<br/> within multi-page images, ensuring efficient navigation and processing. |
41+
| [pages](#pages1) | [Image[]](/imaging/python-net/aspose.imaging/image) | r | Retrieve the pages of the image seamlessly with this intuitive property.<br/> Ideal for developers seeking to access and manipulate individual pages<br/> within multi-page images, ensuring efficient navigation and processing. |
4242
| palette | [IColorPalette](/imaging/python-net/aspose.imaging/icolorpalette) | r/w | Gets or sets the color palette. The color palette is not used when pixels are represented directly. |
4343
| size | [Size](/imaging/python-net/aspose.imaging/size) | r | Gets the object size. |
4444
| size_f | [SizeF](/imaging/python-net/aspose.imaging/sizef) | r | Gets the object size, in inches. |
@@ -137,6 +137,15 @@ Start working with the [CmxImage](/imaging/python-net/aspose.imaging.fileformats
137137
| stream_container | [StreamContainer](/imaging/python-net/aspose.imaging/streamcontainer) | The stream container. |
138138
| load_options | [LoadOptions](/imaging/python-net/aspose.imaging/loadoptions) | The load options. |
139139

140+
### Property: pages {#pages1}
141+
142+
Retrieve the pages of the image seamlessly with this intuitive property.<br/> Ideal for developers seeking to access and manipulate individual pages<br/> within multi-page images, ensuring efficient navigation and processing.
143+
144+
**See also:**
145+
146+
**[Example # 1](#example_143)**: The following example shows how to cache all pages of a CMX image.
147+
148+
140149
### Method: can_load(file_path) [static] {#can_load_file_path_1}
141150

142151

@@ -1439,3 +1448,23 @@ Customize the color palette of the image with this intuitive method. Ideal for<b
14391448
| palette | [IColorPalette](/imaging/python-net/aspose.imaging/icolorpalette) | The palette to set. |
14401449
| update_colors | bool | if set to <c>true</c> colors will be updated according to the new palette; otherwise color indexes remain unchanged. Note that unchanged indexes may crash the image on loading if some indexes have no corresponding palette entries. |
14411450

1451+
## **Examples**
1452+
### The following example shows how to cache all pages of a CMX image. {#example_143}
1453+
``` python
1454+
import aspose.pycore as aspycore
1455+
from aspose.imaging import Image
1456+
from aspose.imaging.fileformats.cmx import CmxImage
1457+
from os.path import join
1458+
1459+
dir_: str = "c:\\temp"
1460+
# Load an image from a CMX file.
1461+
with aspycore.as_of(Image.load(join(dir_, "sample.cmx")), CmxImage) as image:
1462+
# This call caches only the default page.
1463+
image.cache_data()
1464+
# Cache all pages so that no additional data loading will be performed from the underlying data stream.
1465+
for page in image.pages:
1466+
page.cache_data()
1467+
1468+
1469+
```
1470+

english/python-net/aspose.imaging.fileformats.dicom/dicomimage/_index.md

Lines changed: 57 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -291,7 +291,7 @@ Enhance image luminance with the adjustment of _brightness_, a<br/> p
291291

292292
**See also:**
293293

294-
**[Example # 1](#example_122)**: The following example performs brightness correction of a DICOM image.
294+
**[Example # 1](#example_125)**: The following example performs brightness correction of a DICOM image.
295295

296296

297297
### Method: adjust_contrast(contrast) {#adjust_contrast_contrast_4}
@@ -312,7 +312,7 @@ Enhance [Image](/imaging/python-net/aspose.imaging/image/) contrast with this us
312312

313313
**See also:**
314314

315-
**[Example # 1](#example_123)**: The following example performs contrast correction of a DICOM image.
315+
**[Example # 1](#example_126)**: The following example performs contrast correction of a DICOM image.
316316

317317

318318
### Method: adjust_gamma(gamma) {#adjust_gamma_gamma_5}
@@ -333,7 +333,7 @@ Enhance image quality and adjust it with gamma correction, a powerful technique<
333333

334334
**See also:**
335335

336-
**[Example # 1](#example_120)**: The following example performs gamma-correction of a DICOM image.
336+
**[Example # 1](#example_123)**: The following example performs gamma-correction of a DICOM image.
337337

338338

339339
### Method: adjust_gamma(gamma_red, gamma_green, gamma_blue) {#adjust_gamma_gamma_red_gamma_green_gamma_blue_6}
@@ -356,7 +356,7 @@ Achieve precise color adjustments by applying gamma correction independently<br/
356356

357357
**See also:**
358358

359-
**[Example # 1](#example_121)**: The following example performs gamma-correction of a DICOM image applying dif...
359+
**[Example # 1](#example_124)**: The following example performs gamma-correction of a DICOM image applying dif...
360360

361361

362362
### Method: binarize_bradley(brightness_difference) {#binarize_bradley_brightness_difference_7}
@@ -405,6 +405,12 @@ Easily convert the image into a binary format using a predefined threshold<br/>
405405
| :- | :- | :- |
406406
| threshold | byte | Threshold value. If corresponding gray value of a pixel is greater than threshold, a value of<br/> 255 will be assigned to it, 0 otherwise. |
407407

408+
409+
**See also:**
410+
411+
**[Example # 1](#example_120)**: The following example binarizes a DICOM image with the predefined threshold. ...
412+
413+
408414
### Method: blend(origin, overlay, overlay_alpha) {#blend_origin_overlay_overlay_alpha_10}
409415

410416

@@ -2523,7 +2529,26 @@ Writes the whole scan line to the specified scan line index.
25232529
| pixels | [Color[]](/imaging/python-net/aspose.imaging/color) | The pixel colors array to write. |
25242530

25252531
## **Examples**
2526-
### The following example performs gamma-correction of a DICOM image. {#example_120}
2532+
### The following example binarizes a DICOM image with the predefined threshold. Binarized images contain only 2 colors - black and white. {#example_120}
2533+
``` python
2534+
import aspose.pycore as aspycore
2535+
from aspose.imaging import Image
2536+
from aspose.imaging.imageoptions import PngOptions
2537+
from aspose.imaging.fileformats.dicom import DicomImage
2538+
from os.path import join
2539+
2540+
dir_: str = "c:\\temp"
2541+
with Image.load(join(dir_, "sample.dicom")) as image:
2542+
dicom_image = aspycore.as_of(image, DicomImage)
2543+
# Binarize the image with a threshold value of 127.
2544+
# If a corresponding gray value of a pixel is greater than 127, a value of 255 will be assigned to it, 0 otherwise.
2545+
dicom_image.binarize_fixed(127)
2546+
dicom_image.save(join(dir_, "sample.BinarizeFixed.png"), PngOptions())
2547+
2548+
2549+
```
2550+
2551+
### The following example performs gamma-correction of a DICOM image. {#example_123}
25272552
``` python
25282553
import aspose.pycore as aspycore
25292554
from aspose.imaging import Image
@@ -2542,7 +2567,7 @@ with Image.load(join(dir_, "sample.dicom")) as image:
25422567

25432568
```
25442569

2545-
### The following example performs gamma-correction of a DICOM image applying different coefficients for color components. {#example_121}
2570+
### The following example performs gamma-correction of a DICOM image applying different coefficients for color components. {#example_124}
25462571
``` python
25472572

25482573
import aspose.pycore as aspycore
@@ -2561,7 +2586,7 @@ with Image.load(join(dir_, "sample.dicom")) as image:
25612586

25622587
```
25632588

2564-
### The following example performs brightness correction of a DICOM image. {#example_122}
2589+
### The following example performs brightness correction of a DICOM image. {#example_125}
25652590
``` python
25662591

25672592
import aspose.pycore as aspycore
@@ -2580,7 +2605,7 @@ with Image.load(join(dir_, "sample.dicom")) as image:
25802605

25812606
```
25822607

2583-
### The following example performs contrast correction of a DICOM image. {#example_123}
2608+
### The following example performs contrast correction of a DICOM image. {#example_126}
25842609
``` python
25852610

25862611
import aspose.pycore as aspycore
@@ -2599,7 +2624,29 @@ with Image.load(join(dir_, "sample.dicom")) as image:
25992624

26002625
```
26012626

2602-
### Use RLE compression in DICOM image. {#example_155}
2627+
### Use JPEG 2000 compression in DICOM image. {#example_162}
2628+
``` python
2629+
import aspose.pycore as aspycore
2630+
from aspose.imaging import Image
2631+
from aspose.imaging.imageoptions import Jpeg2000Options, DicomOptions
2632+
from aspose.imaging.fileformats.jpeg2000 import Jpeg2000Codec, Compression, CompressionType, ColorType
2633+
2634+
with Image.load("original.jpg") as input_image:
2635+
obj_init = Jpeg2000Options()
2636+
obj_init.codec = Jpeg2000Codec.JP2
2637+
obj_init.irreversible = False
2638+
obj_init2 = Compression()
2639+
obj_init2.type_ = CompressionType.JPEG2000
2640+
obj_init2.jpeg2000 = obj_init
2641+
options = DicomOptions()
2642+
options.color_type = ColorType.RGB_24_BIT
2643+
options.compression = obj_init2
2644+
input_image.save("original_JPEG2000.dcm", options)
2645+
2646+
2647+
```
2648+
2649+
### Use RLE compression in DICOM image. {#example_163}
26032650
``` python
26042651

26052652
from aspose.imaging import Image
@@ -2617,7 +2664,7 @@ with Image.load("original.jpg") as input_image:
26172664

26182665
```
26192666

2620-
### Change the color type in DICOM compression. {#example_156}
2667+
### Change the color type in DICOM compression. {#example_164}
26212668
``` python
26222669

26232670
from aspose.imaging import Image

english/python-net/aspose.imaging.fileformats.emf/emfimage/_index.md

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1496,3 +1496,25 @@ Sets the image palette.
14961496
| palette | [IColorPalette](/imaging/python-net/aspose.imaging/icolorpalette) | The palette to set. |
14971497
| update_colors | bool | if set to <c>true</c> colors will be updated according to the new palette; otherwise color indexes remain unchanged. Note that unchanged indexes may crash the image on loading if some indexes have no corresponding palette entries. |
14981498

1499+
## **Examples**
1500+
### The following example shows how to convert a emz images to emf format {#example_147}
1501+
``` python
1502+
import aspose.pycore as aspycore
1503+
from aspose.imaging import Image, SizeF
1504+
from aspose.imaging.imageoptions import EmfRasterizationOptions, EmfOptions
1505+
from os.path import join
1506+
1507+
file: str = "example.emz"
1508+
base_folder: str = join("D:", "Compressed")
1509+
input_file: str = join(base_folder, file)
1510+
out_file: str = input_file + ".emf"
1511+
with Image.load(input_file) as image:
1512+
obj_init = EmfRasterizationOptions()
1513+
obj_init.page_size = aspycore.cast(SizeF, image.size)
1514+
obj_init2 = EmfOptions()
1515+
obj_init2.vector_rasterization_options = obj_init
1516+
image.save(out_file, obj_init2)
1517+
1518+
1519+
```
1520+

english/python-net/aspose.imaging.fileformats.gif/gifimage/_index.md

Lines changed: 38 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -331,7 +331,7 @@ Adjusts the brightness of the image according to the specified<br/> _
331331

332332
**See also:**
333333

334-
**[Example # 1](#example_102)**: The following example performs brightness correction of a GIF image.
334+
**[Example # 1](#example_103)**: The following example performs brightness correction of a GIF image.
335335

336336

337337
### Method: adjust_contrast(contrast) {#adjust_contrast_contrast_4}
@@ -352,7 +352,7 @@ Adjusts the contrast of the image, enhancing or reducing the difference in <br/>
352352

353353
**See also:**
354354

355-
**[Example # 1](#example_103)**: The following example performs contrast correction of a GIF image.
355+
**[Example # 1](#example_104)**: The following example performs contrast correction of a GIF image.
356356

357357

358358
### Method: adjust_gamma(gamma) {#adjust_gamma_gamma_5}
@@ -373,7 +373,7 @@ Enhance image quality by applying gamma correction. This method adjusts the colo
373373

374374
**See also:**
375375

376-
**[Example # 1](#example_100)**: The following example performs gamma-correction of a GIF image.
376+
**[Example # 1](#example_101)**: The following example performs gamma-correction of a GIF image.
377377

378378

379379
### Method: adjust_gamma(gamma_red, gamma_green, gamma_blue) {#adjust_gamma_gamma_red_gamma_green_gamma_blue_6}
@@ -396,7 +396,7 @@ Gamma-correction of an image applies a nonlinear adjustment to the pixel values,
396396

397397
**See also:**
398398

399-
**[Example # 1](#example_101)**: The following example performs gamma-correction of a GIF image applying diffe...
399+
**[Example # 1](#example_102)**: The following example performs gamma-correction of a GIF image applying diffe...
400400

401401

402402
### Method: binarize_bradley(brightness_difference) {#binarize_bradley_brightness_difference_7}
@@ -448,7 +448,7 @@ Binarization of an image with a predefined threshold converts a grayscale or col
448448

449449
**See also:**
450450

451-
**[Example # 1](#example_97)**: The following example binarizes a GIF image with the predefined threshold. Bi...
451+
**[Example # 1](#example_98)**: The following example binarizes a GIF image with the predefined threshold. Bi...
452452

453453

454454
### Method: blend(origin, overlay, overlay_alpha) {#blend_origin_overlay_overlay_alpha_10}
@@ -925,6 +925,12 @@ Crop the image using a specified rectangle area. This operation removes the oute
925925
| :- | :- | :- |
926926
| rectangle | [Rectangle](/imaging/python-net/aspose.imaging/rectangle) | The rectangle. |
927927

928+
929+
**See also:**
930+
931+
**[Example # 1](#example_97)**: The following example crops a GIF image. The cropping area is be specified vi...
932+
933+
928934
### Method: dither(dithering_method, bits_count) {#dither_dithering_method_bits_count_32}
929935

930936

@@ -2690,7 +2696,28 @@ with GifFrameBlock(100, 100) as firstBlock:
26902696

26912697
```
26922698

2693-
### The following example binarizes a GIF image with the predefined threshold. Binarized images contain only 2 colors - black and white. {#example_97}
2699+
### The following example crops a GIF image. The cropping area is be specified via aspose.imaging.Rectangle. {#example_97}
2700+
``` python
2701+
import aspose.pycore as aspycore
2702+
from aspose.imaging import Image, Rectangle
2703+
from aspose.imaging.imageoptions import PngOptions
2704+
from aspose.imaging.fileformats.gif import GifImage
2705+
from os.path import join
2706+
2707+
dir_: str = "c:\\temp"
2708+
with Image.load(join(dir_, "sample.gif")) as image:
2709+
gif_image = aspycore.as_of(image, GifImage)
2710+
# Crop the image. The cropping area is the rectangular central area of the image.
2711+
area = Rectangle(gif_image.width // 4, gif_image.height // 4, gif_image.width // 2,
2712+
gif_image.height // 2)
2713+
gif_image.crop(area)
2714+
# Save the cropped image to PNG
2715+
gif_image.save(join(dir_, "sample.Crop.png"), PngOptions())
2716+
2717+
2718+
```
2719+
2720+
### The following example binarizes a GIF image with the predefined threshold. Binarized images contain only 2 colors - black and white. {#example_98}
26942721
``` python
26952722

26962723
import aspose.pycore as aspycore
@@ -2710,7 +2737,7 @@ with Image.load(join(dir_, "sample.gif")) as image:
27102737

27112738
```
27122739

2713-
### The following example performs gamma-correction of a GIF image. {#example_100}
2740+
### The following example performs gamma-correction of a GIF image. {#example_101}
27142741
``` python
27152742
import aspose.pycore as aspycore
27162743
from aspose.imaging import Image
@@ -2728,7 +2755,7 @@ with Image.load(join(dir_, "sample.gif")) as image:
27282755

27292756
```
27302757

2731-
### The following example performs gamma-correction of a GIF image applying different coefficients for color components. {#example_101}
2758+
### The following example performs gamma-correction of a GIF image applying different coefficients for color components. {#example_102}
27322759
``` python
27332760

27342761
import aspose.pycore as aspycore
@@ -2747,7 +2774,7 @@ with Image.load(join(dir_, "sample.gif")) as image:
27472774

27482775
```
27492776

2750-
### The following example performs brightness correction of a GIF image. {#example_102}
2777+
### The following example performs brightness correction of a GIF image. {#example_103}
27512778
``` python
27522779

27532780
import aspose.pycore as aspycore
@@ -2766,7 +2793,7 @@ with Image.load(join(dir_, "sample.gif")) as image:
27662793

27672794
```
27682795

2769-
### The following example performs contrast correction of a GIF image. {#example_103}
2796+
### The following example performs contrast correction of a GIF image. {#example_104}
27702797
``` python
27712798

27722799

@@ -2800,7 +2827,7 @@ with Image.load(join(dir_, "sample.gif")) as image:
28002827

28012828
```
28022829

2803-
### Export of part of animation from GIF image based on time interval. {#example_162}
2830+
### Export of part of animation from GIF image based on time interval. {#example_170}
28042831
``` python
28052832
from aspose.imaging import Image
28062833
from aspose.imaging.imageoptions import GifOptions, MultiPageOptions, MultiPageMode, TimeInterval

english/python-net/aspose.imaging.fileformats.svg/svgimage/_index.md

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1508,3 +1508,25 @@ Applies a specified palette to the image, enabling customization of color <br/>
15081508
| palette | [IColorPalette](/imaging/python-net/aspose.imaging/icolorpalette) | The palette to set. |
15091509
| update_colors | bool | if set to <c>true</c> colors will be updated according to the new palette; otherwise color indexes remain unchanged. Note that unchanged indexes may crash the image on loading if some indexes have no corresponding palette entries. |
15101510

1511+
## **Examples**
1512+
### The following example shows how to convert a svgz images to svg fromat {#example_149}
1513+
``` python
1514+
import aspose.pycore as aspycore
1515+
from aspose.imaging import Image, SizeF
1516+
from aspose.imaging.imageoptions import SvgRasterizationOptions, SvgOptions
1517+
from os.path import join
1518+
1519+
file: str = "example.svgz"
1520+
base_folder: str = join("D:", "Compressed")
1521+
input_file: str = join(base_folder, file)
1522+
out_file: str = input_file + ".svg"
1523+
with Image.load(input_file) as image:
1524+
obj_init = SvgRasterizationOptions()
1525+
obj_init.page_size = aspycore.cast(SizeF, image.size)
1526+
obj_init2 = SvgOptions()
1527+
obj_init2.vector_rasterization_options = obj_init
1528+
image.save(out_file, obj_init2)
1529+
1530+
1531+
```
1532+

0 commit comments

Comments
 (0)