@@ -149,7 +149,7 @@ THISDIR = str(Path(__file__).resolve().parent)
149
149
import layeredimage.io
150
150
151
151
# Do stuff
152
- ora = layeredimage.io.openLayerImage(THISDIR + " /image.ora" )
152
+ ora = layeredimage.io.openLayerImage(f " { THISDIR } /image.ora " )
153
153
154
154
imageDimensions = ora.dimensions
155
155
# There are a load of handy functions for getting layers, and adding new
@@ -161,10 +161,10 @@ layer.image = Image.new("RGBA", imageDimensions)
161
161
ora.layersAndGroups[0 ] = layer
162
162
163
163
# And let's save
164
- layeredimage.io.saveLayerImage(THISDIR + " /image(modified).ora" , ora)
164
+ layeredimage.io.saveLayerImage(f " { THISDIR } /image(modified).ora " , ora)
165
165
166
166
# Let's save a flattened version too
167
- ora.getFlattenLayers().save(THISDIR + " /image(modified).png" )
167
+ ora.getFlattenLayers().save(f " { THISDIR } /image(modified).png " )
168
168
169
169
# Doing stuff with a group
170
170
group = ora.getLayerOrGroup(1 ) # For the sake of the e.g. this is a group
@@ -192,34 +192,34 @@ sys.path.insert(0, os.path.dirname(THISDIR))
192
192
import layeredimage.io
193
193
194
194
# ORA
195
- ora = layeredimage.io.openLayerImage(THISDIR + " /base24.ora" )
196
- layeredimage.io.saveLayerImage(THISDIR + " /base24(ora).ora" , ora)
197
- layeredimage.io.saveLayerImage(THISDIR + " /base24(ora).tiff" , ora)
198
- ora.getFlattenLayers().save(THISDIR + " /base24(ora).png" )
195
+ ora = layeredimage.io.openLayerImage(f " { THISDIR } /base24.ora " )
196
+ layeredimage.io.saveLayerImage(f " { THISDIR } /base24(ora).ora " , ora)
197
+ layeredimage.io.saveLayerImage(f " { THISDIR } /base24(ora).tiff " , ora)
198
+ ora.getFlattenLayers().save(f " { THISDIR } /base24(ora).png " )
199
199
200
200
# PSD
201
- psd = layeredimage.io.openLayerImage(THISDIR + " /base24.psd" )
202
- layeredimage.io.saveLayerImage(THISDIR + " /base24(psd).ora" , psd)
203
- layeredimage.io.saveLayerImage(THISDIR + " /base24(psd).tiff" , psd)
204
- psd.getFlattenLayers().save(THISDIR + " /base24(psd).png" )
201
+ psd = layeredimage.io.openLayerImage(f " { THISDIR } /base24.psd " )
202
+ layeredimage.io.saveLayerImage(f " { THISDIR } /base24(psd).ora " , psd)
203
+ layeredimage.io.saveLayerImage(f " { THISDIR } /base24(psd).tiff " , psd)
204
+ psd.getFlattenLayers().save(f " { THISDIR } /base24(psd).png " )
205
205
206
206
# PDN
207
- pdn = layeredimage.io.openLayerImage(THISDIR + " /base24.pdn" )
208
- layeredimage.io.saveLayerImage(THISDIR + " /base24(pdn).ora" , pdn)
209
- layeredimage.io.saveLayerImage(THISDIR + " /base24(pdn).tiff" , pdn)
210
- pdn.getFlattenLayers().save(THISDIR + " /base24(pdn).png" )
207
+ pdn = layeredimage.io.openLayerImage(f " { THISDIR } /base24.pdn " )
208
+ layeredimage.io.saveLayerImage(f " { THISDIR } /base24(pdn).ora " , pdn)
209
+ layeredimage.io.saveLayerImage(f " { THISDIR } /base24(pdn).tiff " , pdn)
210
+ pdn.getFlattenLayers().save(f " { THISDIR } /base24(pdn).png " )
211
211
212
212
# XCF
213
- xcf = layeredimage.io.openLayerImage(THISDIR + " /base24.xcf" )
214
- layeredimage.io.saveLayerImage(THISDIR + " /base24(xcf).ora" , xcf)
215
- layeredimage.io.saveLayerImage(THISDIR + " /base24(xcf).tiff" , xcf)
216
- xcf.getFlattenLayers().save(THISDIR + " /base24(xcf).png" )
213
+ xcf = layeredimage.io.openLayerImage(f " { THISDIR } /base24.xcf " )
214
+ layeredimage.io.saveLayerImage(f " { THISDIR } /base24(xcf).ora " , xcf)
215
+ layeredimage.io.saveLayerImage(f " { THISDIR } /base24(xcf).tiff " , xcf)
216
+ xcf.getFlattenLayers().save(f " { THISDIR } /base24(xcf).png " )
217
217
218
218
# TIFF
219
- tiff = layeredimage.io.openLayerImage(THISDIR + " /base24.tiff" )
220
- layeredimage.io.saveLayerImage(THISDIR + " /base24(tiff).ora" , tiff)
221
- layeredimage.io.saveLayerImage(THISDIR + " /base24(tiff).tiff" , tiff)
222
- tiff.getFlattenLayers().save(THISDIR + " /base24(tiff).png" )
219
+ tiff = layeredimage.io.openLayerImage(f " { THISDIR } /base24.tiff " )
220
+ layeredimage.io.saveLayerImage(f " { THISDIR } /base24(tiff).ora " , tiff)
221
+ layeredimage.io.saveLayerImage(f " { THISDIR } /base24(tiff).tiff " , tiff)
222
+ tiff.getFlattenLayers().save(f " { THISDIR } /base24(tiff).png " )
223
223
```
224
224
225
225
## Documentation
0 commit comments