layeredimage/io/ora.py
def saveLayer_ORA(fileName: str, layeredImage: LayeredImage) -> None:
	"""Save a layered image as .ora."""
	from pyora import Project

	blendLookup = {
		BlendType.NORMAL: "svg:src-over",
		BlendType.MULTIPLY: "svg:multiply",
		BlendType.COLOURBURN: "svg:color-burn",
		BlendType.COLOURDODGE: "svg:color-dodge",
		BlendType.REFLECT: "svg:",
		BlendType.OVERLAY: "svg:overlay",
		BlendType.DIFFERENCE: "svg:difference",
		BlendType.LIGHTEN: "svg:lighten",
		BlendType.DARKEN: "svg:darken",
		BlendType.SCREEN: "svg:screen",
		BlendType.SOFTLIGHT: "svg:soft-light",
		BlendType.HARDLIGHT: "svg:hard-light",
		BlendType.HUE: "svg:hue",
		BlendType.SATURATION: "svg:saturation",
		BlendType.COLOUR: "svg:color",
		BlendType.LUMINOSITY: "svg:luminosity",
		BlendType.ADDITIVE: "svg:plus",
		BlendType.DESTIN: "svg:dst-in",
		BlendType.DESTOUT: "svg:dst-out",
		BlendType.DESTATOP: "svg:dst-atop",
		BlendType.SRCATOP: "svg:src-atop",
	}
	project = Project.new(layeredImage.dimensions[0], layeredImage.dimensions[1])
	for layerOrGroup in layeredImage.layersAndGroups:
		if isinstance(layerOrGroup, Layer):
			project = addLayer_ORA(project, layerOrGroup, blendLookup)
		else:
			group = project.add_group(
				layerOrGroup.name,
				offsets=layerOrGroup.offsets,
				opacity=layerOrGroup.opacity,
				visible=layerOrGroup.visible,
				composite_op=blendModeLookup(layerOrGroup.blendmode, blendLookup, "svg:src-over"),
			)
			for layer in layerOrGroup.layers:
				group = addLayer_ORA(group, layer, blendLookup)
	project.save(fileName)
Save a layered image as .ora.
Save a layered image as .ora.
Save a layered image as . ora .
def saveLayer_ORA(fileName: str, layeredImage: LayeredImage) -> None:
	from pyora import Project
	blendLookup = {
		BlendType.NORMAL: "svg:src-over",
		BlendType.MULTIPLY: "svg:multiply",
		BlendType.COLOURBURN: "svg:color-burn",
		BlendType.COLOURDODGE: "svg:color-dodge",
		BlendType.REFLECT: "svg:",
		BlendType.OVERLAY: "svg:overlay",
		BlendType.DIFFERENCE: "svg:difference",
		BlendType.LIGHTEN: "svg:lighten",
		BlendType.DARKEN: "svg:darken",
		BlendType.SCREEN: "svg:screen",
		BlendType.SOFTLIGHT: "svg:soft-light",
		BlendType.HARDLIGHT: "svg:hard-light",
		BlendType.HUE: "svg:hue",
		BlendType.SATURATION: "svg:saturation",
		BlendType.COLOUR: "svg:color",
		BlendType.LUMINOSITY: "svg:luminosity",
		BlendType.ADDITIVE: "svg:plus",
		BlendType.DESTIN: "svg:dst-in",
		BlendType.DESTOUT: "svg:dst-out",
		BlendType.DESTATOP: "svg:dst-atop",
		BlendType.SRCATOP: "svg:src-atop",
	}
	project = Project.new(layeredImage.dimensions[0], layeredImage.dimensions[1])
	for layerOrGroup in layeredImage.layersAndGroups:
		if isinstance(layerOrGroup, Layer):
			project = addLayer_ORA(project, layerOrGroup, blendLookup)
		else:
			group = project.add_group(
				layerOrGroup.name,
				offsets=layerOrGroup.offsets,
				opacity=layerOrGroup.opacity,
				visible=layerOrGroup.visible,
				composite_op=blendModeLookup(layerOrGroup.blendmode, blendLookup, "svg:src-over"),
			)
			for layer in layerOrGroup.layers:
				group = addLayer_ORA(group, layer, blendLookup)
	project.save(fileName)
def saveLayer_ORA ( fileName : str , layeredImage : LayeredImage ) -> None : from pyora import Project blendLookup = { BlendType . NORMAL : "svg:src-over" , BlendType . MULTIPLY : "svg:multiply" , BlendType . COLOURBURN : "svg:color-burn" , BlendType . COLOURDODGE : "svg:color-dodge" , BlendType . REFLECT : "svg:" , BlendType . OVERLAY : "svg:overlay" , BlendType . DIFFERENCE : "svg:difference" , BlendType . LIGHTEN : "svg:lighten" , BlendType . DARKEN : "svg:darken" , BlendType . SCREEN : "svg:screen" , BlendType . SOFTLIGHT : "svg:soft-light" , BlendType . HARDLIGHT : "svg:hard-light" , BlendType . HUE : "svg:hue" , BlendType . SATURATION : "svg:saturation" , BlendType . COLOUR : "svg:color" , BlendType . LUMINOSITY : "svg:luminosity" , BlendType . ADDITIVE : "svg:plus" , BlendType . DESTIN : "svg:dst-in" , BlendType . DESTOUT : "svg:dst-out" , BlendType . DESTATOP : "svg:dst-atop" , BlendType . SRCATOP : "svg:src-atop" , } project = Project . new ( layeredImage . dimensions [ 0 ] , layeredImage . dimensions [ 1 ] ) for layerOrGroup in layeredImage . layersAndGroups : if isinstance ( layerOrGroup , Layer ) : project = addLayer_ORA ( project , layerOrGroup , blendLookup ) else : group = project . add_group ( layerOrGroup . name , offsets = layerOrGroup . offsets , opacity = layerOrGroup . opacity , visible = layerOrGroup . visible , composite_op = blendModeLookup ( layerOrGroup . blendmode , blendLookup , "svg:src-over" ) , ) for layer in layerOrGroup . layers : group = addLayer_ORA ( group , layer , blendLookup ) project . save ( fileName )
Save a layered image as .ora.
Save a layered image as . ora .
"""Save a layered image as .ora."""
fileName
str
layeredImage
LayeredImage