SMIL 1.1.1
Loading...
Searching...
No Matches
copy_crop.py
1from smilPython import *
2
3im1 = Image("https://smil.cmm.minesparis.psl.eu/images/barbara.png")
4im2 = Image("https://smil.cmm.minesparis.psl.eu/images/lena.png")
5im3 = Image(im1)
6
7im1.show()
8im2.show()
9im3.show()
10
11# Crop the content of im1 from (256, 0) to im3 (which will be resized)
12crop(im1, 256, 0, 256, 256, im3)
13
14# Copy the content of im2 and put it at position (0, 256) in im1
15copy(im2, im1, 0, 256)
16
17# Copy the window starting at (256, 0) and with dimensions 128x128 and put it at (128, 128) in im2
18copy(im1, 256, 0, 128, 128, im2, 128, 128)
19# Same as previous (simple way)
20copy(im1, 256, 0, im2, 128, 128)
21
22# Create a 3D image and copy slices inside
23im3D = Image(im2.getWidth(), im2.getHeight(), 3)
24im3D << 0
25copy(im1, 0, 256, im3D)
26copy(im3, im3D, 0, 0, 2)
27close(im3D, im3D, cbSE())
28im3D.show()