Closed jcupitt closed 4 years ago
We could certainly load all the layers as single VipsImage somehow. What I couldn't figure out yet is, how to do that the most efficient way. I know I can use the page
option to load a certain page, but I wouldn't know how many pages there are until the last load fails. Which seems a little bit inefficient (especially since most images are just one page). Is there a way to achieve that?
You set the number of pages to -1 and it'll load all of them. For example:
$ vips copy nipguide.pdf[n=-1] x.tif
Makes an N-page TIFF, with a page for each page of the PDF.
Many page images are represented internally as very tall, thin "toilet paper" images, with a page-height
metadata item giving the sheet size (sorry about the analogy).
Thanks for that, did some very basic layers support in this branch: https://github.com/rokka-io/imagine-vips/tree/layers-support
It loads a gif image with ['n' => -1] and if it has more than one "layer", it crops the image up by page-height
and puts them into layers, doesn't do much more than that yet and lower on my prio list currently.
Had some ideas how to do the whole animated gif support (with gifsicle), see #3 for details.
This is good enough for now. Closing issue finally.
You can save GIF via the magick saver, of course.
vips invert something.gif[n=-1] other.gif
Will invert an animated gif.
Hello and congratulations on your release!
Re. layers, libvips can save multi-page TIFF images, and can load multi-page PDF, TIFF, and GIF. It can also load any multi-page format supported by libMagick.
It's certainly true that GIF save is not supported :(