layeredimage/io/gif.py
def openLayer_GIF(file: str) -> LayeredImage:
	"""Open a .gif file into a layered image."""
	project = Image.open(file)
	projectSize = project.size
	layers = []
	for index in range(project.n_frames):  # type:ignore
		project.seek(index)
		layers.append(
			Layer(
				f"Frame {len(layers) + 1} ({project.info['duration']}ms)",
				project.copy(),
				projectSize,
			)
		)
	project.close()
	return LayeredImage(layers, projectSize)
Open a .gif file into a layered image.
Open a .gif file into a layered image.
Open a . gif file into a layered image .
def openLayer_GIF(file: str) -> LayeredImage:
	project = Image.open(file)
	projectSize = project.size
	layers = []
	for index in range(project.n_frames):  
		project.seek(index)
		layers.append(
			Layer(
				f"Frame {len(layers) + 1} ({project.info['duration']}ms)",
				project.copy(),
				projectSize,
			)
		)
	project.close()
	return LayeredImage(layers, projectSize)
def openLayer_GIF ( file : str ) -> LayeredImage : project = Image . open ( file ) projectSize = project . size layers = [ ] for index in range ( project . n_frames ) : project . seek ( index ) layers . append ( Layer ( f"Frame {len(layers) + 1} ({project.info['duration']}ms)" , project . copy ( ) , projectSize , ) ) project . close ( ) return LayeredImage ( layers , projectSize )
Open a .gif file into a layered image.
Open a . gif file into a layered image .
"""Open a .gif file into a layered image.""" # type:ignore
file
str