From 834d30041efc9cc4d962ac6f9b28198dca29b311 Mon Sep 17 00:00:00 2001 From: walter Date: Tue, 16 May 2023 00:36:45 -0400 Subject: [PATCH] add support for image coalesce --- src/wand/magick.rs | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/src/wand/magick.rs b/src/wand/magick.rs index ba96095..c217865 100644 --- a/src/wand/magick.rs +++ b/src/wand/magick.rs @@ -262,6 +262,18 @@ impl MagickWand { } } + /// Rebuilds image sequence with each frame size the same as first frame, and composites each frame atop of previous. + /// Only affects GIF, and other formats with multiple pages/layers. + pub fn coalesce(&mut self) -> Result<()> { + let result = unsafe { bindings::MagickCoalesceImages(self.wand) }; + if result.is_null() { + Err(MagickError("failed to coalesce images")) + } else { + self.wand = result; + Ok(()) + } + } + // Replaces colors in the image from a color lookup table. pub fn clut_image( &self,