Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

how to use OptimizeImageLayers #896

Closed
2016xjtuzyt opened this issue Dec 11, 2017 · 7 comments
Closed

how to use OptimizeImageLayers #896

2016xjtuzyt opened this issue Dec 11, 2017 · 7 comments

Comments

@2016xjtuzyt
Copy link

hi,
my ImageMagic version is ImageMagick 6.7.8-9 in Centos 6.5,
I use this command "convert test.gif -fuzz 15% -layers Optimize result.gif" and get the small animation gif.
how to convert this command to C++ code?
when I write the this code:
Image img;
img.read("animation.gif");
Image OptimizeImageLayers(img);
img.write("out.gif");
the out.gif is one frame, not animation.
Thanks!

@khanhas
Copy link

khanhas commented Dec 11, 2017

Magick::read method is only able to read one frame. If you want to read multiple frames, use readImages to put them in a vector. So later, you can use STL interface to edit them and save as animated GIF.

std::vector<Magick::Image> frameList;
Magick::readImages(&frameList, "animation.gif");

@2016xjtuzyt
Copy link
Author

@khanhas thanks for your reply. i can't find optimizeImagelayers in STL.h. this function is define in imageMagick7.xx. when i install imageMagick7.0.7,there is something wrong as follows:
MagickCore/.libs/libMagickCore-7.Q16HDRI.so: undefined reference to `WebPMemoryWriterClear'
collect2: error: ld returned 1 exit status
my system is Centos6.5, can you help me?

@khanhas
Copy link

khanhas commented Dec 12, 2017

Sorry, I do not use Linux right now so I have no idea how to fix that.
Seems like there's something wrong with WebP library.

@2016xjtuzyt
Copy link
Author

@khanhas thank you very much.

@magiclen
Copy link

magiclen commented Dec 29, 2017

I got the same message undefined reference to 'WebPMemoryWriterClear' when I compiled ImageMagick7.0.7-18 on CentOS. But ImageMagick7.0.7-11 is fine. It can be compiled and used on CentOS successfully.

@urban-warrior
Copy link
Member

We added a patch to the ImageMagick master branch to check the version of the libwebpmux library. Let us know if the patch fixes the linking issue under CentOS 6.5.

@magiclen
Copy link

@urban-warrior I've tried ImageMagick from the master branch, and it can be successfully compiled now!

netbsd-srcmastr pushed a commit to NetBSD/pkgsrc that referenced this issue Jan 8, 2018
2018-01-06  7.0.7-21 Cristy  <quetzlzacatenango@image...>
  * Release ImageMagick version 7.0.0-21, GIT revision 22168:a91afc45b:20180106.

2018-01-06  7.0.7-21 Dirk Lemstra <dirk@lem.....org>
  * Fix some enum values in the OpenCL code.

2018-01-06  7.0.7-20 Cristy  <quetzlzacatenango@image...>
  * Release ImageMagick version 7.0.7-20, GIT revision 22161:33a04d3e5:20180105.

2018-01-05  7.0.7-20 Cristy  <quetzlzacatenango@image...>
  * Fixed numerous memory leaks (reference
    https://github.com/ImageMagick/ImageMagick/issues).

2018-01-01  7.0.7-19 Cristy  <quetzlzacatenango@image...>
  * Release ImageMagick version 7.0.7-19, GIT revision 22133:977fe08bf:20180101.

2017-12-29  7.0.7-19 Cristy  <quetzlzacatenango@image...>
  * Check for webpmux library version 0.4.4 (reference
    ImageMagick/ImageMagick#896).

2017-12-26  7.0.7-18 Cristy  <quetzlzacatenango@image...>
  * Release ImageMagick version 7.0.7-18, GIT revision 22096:ad4bdeb40:20171228.

2017-12-28  7.0.7-18 Cristy  <quetzlzacatenango@image...>
  * Fix error reading from pipe under Windows (reference
    https://www.imagemagick.org/discourse-server/viewtopic.php?f=3&t=33288).

2017-12-26  7.0.7-17 Cristy  <quetzlzacatenango@image...>
  * Release ImageMagick version 7.0.7-17, GIT revision 22093:9caea323b:20171227.

2017-12-26  7.0.7-17 Cristy  <quetzlzacatenango@image...>
  * Fix heap use after free error (reference
    ImageMagick/ImageMagick#918).

2017-12-24  7.0.7-16 Cristy  <quetzlzacatenango@image...>
  * Release ImageMagick version 7.0.7-16, GIT revision 22038:e55dc7626:20171225.

2017-12-18  7.0.7-16 Cristy  <quetzlzacatenango@image...>
  * Fix error reading multi-layer XCF image file.
  * Fix possible stack overflow in WEBP reader (reference
    ImageMagick/ImageMagick#907)
  * Fixed numerous memory leaks (reference
    https://github.com/ImageMagick/ImageMagick/issues).

2017-12-16  7.0.7-15 Cristy  <quetzlzacatenango@image...>
  * Release ImageMagick version 7.0.7-15, GIT revision 21924:30cb31746:20171216.

2017-12-08  7.0.7-15 Cristy  <quetzlzacatenango@image...>
  * Overall standard deviation is the average of each pixel channel (reference
    https://www.imagemagick.org/discourse-server/viewforum.php?f=3).
  * Update to the latest ImageMagick documentation.

2017-12-05  7.0.7-14 Cristy  <quetzlzacatenango@image...>
  * Release ImageMagick version 7.0.7-14, GIT revision 21855:dc73b2aba:20171205.

2017-11-30  7.0.7-14 Cristy  <quetzlzacatenango@image...>
  * Support Stereo composite operator.
  * Fix build failure with --without-modules (reference
    ImageMagick/ImageMagick#890).

2017-11-30  7.0.7-13 Cristy  <quetzlzacatenango@image...>
  * Release ImageMagick version 7.0.7-13, GIT revision 21823:72cb0fd0c:20171130.

2017-11-30  7.0.7-13 Cristy  <quetzlzacatenango@image...>
  * Fix build failure with libraw 0.14.8 (reference
    ImageMagick/ImageMagick#888).

2017-11-29  7.0.7-12 Cristy  <quetzlzacatenango@image...>
  * Release ImageMagick version 7.0.7-12, GIT revision 21814:5ef2c5a67:20171129.

2017-11-12  7.0.7-12 Cristy  <quetzlzacatenango@image...>
  * The -tint option no longer munges the alpha channel (reference
    http://www.imagemagick.org/discourse-server/viewtopic.php?f=1&t=33070).
  * Don't delete in-memory blob when reading an image (reference
    ImageMagick/ImageMagick#886).
  * Support HDRI color profile management.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

No branches or pull requests

4 participants