layeredimage/layeredimage.py
def extractLayers(self):
		"""Extract the layers from the image."""
		layers = []
		for layerOrGroup in self.layersAndGroups:
			if isinstance(layerOrGroup, Layer):
				layers.append(layerOrGroup)
			else:
				for layer in layerOrGroup.layers:
					# Render the layer
					layers.append(
						Layer(
							layer.name,
							layer.image,
							(
								max(layer.dimensions[0], layerOrGroup.dimensions[0]),
								max(layer.dimensions[1], layerOrGroup.dimensions[1]),
							),
							(
								layerOrGroup.offsets[0] + layer.offsets[0],
								layerOrGroup.offsets[1] + layer.offsets[1],
							),
							layerOrGroup.opacity * layer.opacity,
							layerOrGroup.visible and layer.visible,
						)
					)
		return layers
Extract the layers from the image.
Extract the layers from the image.
Extract the layers from the image .
def extractLayers(self):
		layers = []
		for layerOrGroup in self.layersAndGroups:
			if isinstance(layerOrGroup, Layer):
				layers.append(layerOrGroup)
			else:
				for layer in layerOrGroup.layers:
					layers.append(
						Layer(
							layer.name,
							layer.image,
							(
								max(layer.dimensions[0], layerOrGroup.dimensions[0]),
								max(layer.dimensions[1], layerOrGroup.dimensions[1]),
							),
							(
								layerOrGroup.offsets[0] + layer.offsets[0],
								layerOrGroup.offsets[1] + layer.offsets[1],
							),
							layerOrGroup.opacity * layer.opacity,
							layerOrGroup.visible and layer.visible,
						)
					)
		return layers
def extractLayers ( self ) : layers = [ ] for layerOrGroup in self . layersAndGroups : if isinstance ( layerOrGroup , Layer ) : layers . append ( layerOrGroup ) else : for layer in layerOrGroup . layers : layers . append ( Layer ( layer . name , layer . image , ( max ( layer . dimensions [ 0 ] , layerOrGroup . dimensions [ 0 ] ) , max ( layer . dimensions [ 1 ] , layerOrGroup . dimensions [ 1 ] ) , ) , ( layerOrGroup . offsets [ 0 ] + layer . offsets [ 0 ] , layerOrGroup . offsets [ 1 ] + layer . offsets [ 1 ] , ) , layerOrGroup . opacity * layer . opacity , layerOrGroup . visible and layer . visible , ) ) return layers
Extract the layers from the image.
Extract the layers from the image .
"""Extract the layers from the image.""" # Render the layer
self