Comments (12)
And 0.9.2 is released with those fixes
from imagine-vips.
Do you have some basic example code?
from imagine-vips.
Following should be enough to reproduce it:
$imagine = new \Imagine\Vips\Imagine();
$image = $imagine->load('fox-skater.gif');
$image->layers()->coalesce();
from imagine-vips.
Thanks, could reproduce.
Can you try this branch and see if it does what you expect?
https://github.com/rokka-io/imagine-vips/tree/fix-coalesce
from imagine-vips.
@chregu the result seems not to be correct. Its not longer animated. It seems like it did write the first layer on all other layers or something like that.
from imagine-vips.
@chregu for me it looks like the current vips implementation does coalesce
on read if I use the following gif:
Which have different layers sizes (400, 280, 282, ...):
foreach ($image->layers() as $layer) {
// Output using imagick will be here 400, 280, 282, ...
// Output using vips will be here 400, 400, 400, ...
echo $layer->getSize()->getWidth());
}
$image->layers()->coalesce();
foreach ($image->layers() as $layer) {
echo $layer->getSize()->getWidth()); // will output for both adapters 400, 400, ...
}
Not sure maybe coalesce
should do nothing in the vips implementation. But maybe somebody use coalesce on custom added layers so its maybe still needed but not sure what the correct way to implement it.
from imagine-vips.
Mmmh, strange that it's not animated, but you're right. vips does make all the frames the same size. I look closer into it hopefully today (regarding transparency and such)
from imagine-vips.
@chregu question out of topic do you know if there is something similiar in vips like the following in imagick to get the real memory usage:
$image->getImagick()->getResource(\Imagick::RESOURCETYPE_MEMORY);
from imagine-vips.
vips memory management is a little bit "complicated" due to the way it works (which also makes it much less memory hungry than imagemagick). But the best is to ask the libvips author at https://github.com/libvips/libvips (just make an issue), he's very helpful and responsive
from imagine-vips.
On another topic, I improved the whole coalesce function. It's almost noop if you load a gif with vips. It only does actual coalesce if you add manually frames with a different size.
from imagine-vips.
So, should be good enough now. See #9 for the actual PR
from imagine-vips.
@chregu Thank you for the great support!
from imagine-vips.
Related Issues (18)
- layers HOT 6
- Use the new "delay" feature from vips 8.9 for animated gif with different delays per frame
- Image::save must return ImageInterface HOT 4
- Font HOT 1
- Question regarding PNG quality setting HOT 9
- Broken link “magicksave” in readme HOT 1
- speedup for generateImage HOT 1
- Can't disable automatic image rotation HOT 1
- Issue with loading animated gif file from buffer HOT 2
- Image copy does not work for animated gif file
- Add animated gif support HOT 24
- Issue with loading animated webp HOT 1
- use free icc profiles
- Unable to obtain TIF layers using the last version of vips
- Smart crop / thumbnailing
- stale .icc files in /tmp HOT 1
- help with installing ext-ffi HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from imagine-vips.