Skip to content

Commit 4196617

Browse files
author
Evgeniy Sidenko
committed
Release Aspose.Imaging for Python 25.4
1 parent 9d3c969 commit 4196617

File tree

1 file changed

+39
-0
lines changed

1 file changed

+39
-0
lines changed
Lines changed: 39 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,39 @@
1+
# GROUP: MODIFYING_AND_CONVERTING_IMAGES
2+
3+
from aspose.pycore import as_of
4+
from aspose.imaging import Image, RasterImage
5+
import os
6+
7+
8+
# Initialization
9+
def get_data_root_dir_local():
10+
if 'BASE_DIR' in os.environ:
11+
return os.environ["BASE_DIR"]
12+
return "."
13+
14+
15+
if 'get_data_root_dir' not in dir():
16+
get_data_root_dir = get_data_root_dir_local
17+
18+
if 'get_output_dir' not in dir():
19+
get_output_dir = get_data_root_dir_local
20+
21+
# Example code:
22+
# The path to the documents directory.
23+
data_dir = os.path.join(get_data_root_dir(), 'ModifyingAndConvertingImages')
24+
out_file = os.path.join(get_output_dir(), "result.png")
25+
out_file2 = os.path.join(get_output_dir(), "result2.png")
26+
print("Running example AutoAdjustImageBrightness")
27+
28+
# Load an existing JPG image
29+
with as_of(Image.load(os.path.join(data_dir, "sample.png")), RasterImage) as image:
30+
image.normalize_histogram();
31+
image.save(out_file);
32+
image.adjust_contrast(30);
33+
image.save(out_file2);
34+
35+
if 'SAVE_OUTPUT' not in os.environ:
36+
os.remove(out_file)
37+
os.remove(out_file2)
38+
39+
print("Finished example AutoAdjustImageBrightness")

0 commit comments

Comments
 (0)