Skip to content

Add ability to save animated GIF - #104

Merged
Xrayez merged 12 commits into
gd3from
save-gif
Jul 19, 2021
Merged

Xrayez merged 12 commits into
gd3from
save-gif

Conversation

@Xrayez

@Xrayez Xrayez commented Jul 19, 2021

Copy link
Copy Markdown
Contributor

This adds ability to save both static and animated GIFs.

Example

animated_rotation

This rotating Goost icon was produced with:

func save_gif_animated_rotation():
	var image_frames = ImageFrames.new()

	var angle = 0.0
	for i in 32:
		var frame = Image.new()
		frame.load("res://icon.png")
		GoostImage.rotate(frame, angle, false)
		var delay = 0.02
		image_frames.add_frame(frame, delay)
		angle += TAU / 32.0

	image_frames.save_gif("res://animated_rotation.gif")

@Xrayez Xrayez added this to the 1.1-gd3 milestone Jul 19, 2021
[ci skip]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant