buttery

package module
v0.0.38 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Nov 30, 2026 License: 0BSD Imports: 13 Imported by: 1 module, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

README

buttery: a video editor with manual motion smoothing

GitHub Pages CloudFlare R2 Downloads API Docs CI/CD License AI Donate

stick 'o butter man

SUMMARY

buttery smoothes out transitions at the ends of animated GIFs.

For details on building from source, see DEVELOPMENT.

RESOURCES

Prior art and personal plugs.

  • ffmpeg edits and converts videos
  • gifenc.sh converts numerous video formats to animated GIF's
  • ImageMagick converts between multimedia formats, including GIF and WEBP
  • mcandre/harmonica repackages comic archives
  • mcandre/tigris provides (Kindle) comic book archival utilities
  • mkvtools edits MKV videos
  • VLC plays numerous multimedia formats
  • webm supports audio in animation loops

🧈

Documentation

Overview

Package buttery provides primitives for manipulating GIF animations.

Index

Constants

View Source
const Version = "0.0.38"

Version is semver.

Variables

This section is empty.

Functions

func GetDimensions added in v0.0.2

func GetDimensions(paletteds []*image.Paletted) (int, int)

GetDimensions reports the horizontal and vertical bounds of a GIF.

func GetPaletteSize added in v0.0.2

func GetPaletteSize(paletteds []*image.Paletted) int

GetPaletteSize queries the size of a GIF's color space.

Types

type Config added in v0.0.4

type Config struct {
	// Transparent preserves clear animations (Default false).
	Transparent bool

	// TrimEdges removes frames from the start and end of the incoming sequence (Default zero).
	TrimEdges int

	// TrimStart removes frames from the start of the incoming sequence (Default zero).
	TrimStart int

	// TrimEnd removes fromes frames from the end of the incoming sequence (Default zero).
	TrimEnd int

	// CutInterval removes every nth frame from the incoming sequence (Default zero).
	CutInterval int

	// Window truncates frames from the incoming sequence (Default zero).
	//
	// Zero indicates no window truncation.
	Window int

	// Shift moves the start of the sequence leftward (Default zero).
	Shift int

	// Stitch denotes a loop continuity transition (Default Mirror).
	Stitch Stitch

	// FadeColor denotes a hue for fade transitions (Default black).
	// Alpha channel ignored.
	FadeColor color.RGBA

	// FadeRate denotes the speed of fade transitions (Default 1.0).
	FadeRate float64

	// ScaleDelay multiplies each frame delay by a factor (Default 1.0).
	//
	// The resulting delay is upheld to a lower bound of 2 centisec.
	//
	// A negative scale delay reverses the incoming sequence.
	ScaleDelay float64

	// PanVelocity specifies the number of pixels to shift the canvas per frame (Default: 1.0).
	PanVelocity float64

	// LoopCount denotes how many times to play the animation (Default 0).
	//
	// -1 indicates one play.
	// 0 indicates infinite, endless plays.
	// N indicates 1+N iterations.
	LoopCount int
}

Config models a set of animation editing manipulations.

func NewConfig added in v0.0.4

func NewConfig() Config

NewConfig generates a default Config.

func (*Config) Edit added in v0.0.4

func (o *Config) Edit(destPth string, sourceGif *gif.GIF) error

Edit applies the configured GIF manipulations.

func (*Config) Validate added in v0.0.4

func (o *Config) Validate() error

Validate checks for basic Config integrity.

type Stitch added in v0.0.2

type Stitch int

Stitch models a loop continuity strategy.

const (
	// None ends the incoming sequence as-is.
	None Stitch = iota

	// Mirror follows the end of the incoming sequence by replaying the sequence backwards.
	Mirror

	// FlipH follows the end of the incoming sequence by replaying the sequence reflected horizontally.
	FlipH

	// FlipV follows the end of the incoming sequence by replaying the sequence reflected vertically.
	FlipV

	// Shuffle randomizes the incoming sequence.
	Shuffle

	// PanH shifts the canvas horizontally
	PanH

	// PanV shifts the canvas vertically
	PanV

	// Fade applies time color gradients
	Fade
)

func ParseStitch added in v0.0.2

func ParseStitch(s string) (*Stitch, bool)

ParseStitch generates a Stitch from a string value.

func (Stitch) String added in v0.0.2

func (i Stitch) String() string

func (Stitch) Validate added in v0.0.6

func (o Stitch) Validate() error

Validate rejects out of bound values.

Directories

Path Synopsis
cmd
buttery command
Package main implements a GIF editor application.
Package main implements a GIF editor application.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL
⌂ 换网址