Re: An alternative to gdk-pixbuf



On Thu, 6 Sep 2018 at 11:40, Emmanuele Bassi via gtk-devel-list
<gtk-devel-list gnome org> wrote:
On Wed, 5 Sep 2018 at 19:25, Magnus Bergman <magnus bergman snisurset net> wrote:
Gegl is great for image editing. But not as much for simple viewing.

This is debatable. If I'm viewing a 4000x4000 RGB image on a hidpi display I'm already pushing gdk-pixbuf 
and cairo to their limits because of the scaling factor applied to the window — not only the buffer gets 
loaded uncompressed to allow for zooming, but the image viewer needs to render a CPU-scaled down copy of 
the image.

It doesn't have to be gegl, of course, you could use any image
processing library to load and scale down the images. I made a tiny
image viewer based on libvips:

https://github.com/jcupitt/vipsdisp-tiny

It's 300 lines, but does multi-threaded, asynchronous painting of many
image formats. It can display gigapixel images on very modest
hardware, and it should be quick.

There's a more complete image viewer here:

https://github.com/jcupitt/vipsdisp

That adds most of the usual navigation stuff, though it's not quite
done, I must get back to it. The image display part is a widget you
could easily cut out and paste into other applications. It's in C, but
libvips is a GObject-based library, so it'd be easy to write in any
language.

Here it is displaying a 18k x 8k 16-bit TIFF:

http://www.rollthepotato.net/~john/summer.png

That image takes about 8s to load on this laptop. Here it is
displaying a 120k x 100k pixel ndpi slide image:

http://www.rollthepotato.net/~john/slide.png

That image loads instantly, since ndpi supports random access and
vipsdisp can just load the parts it needs to paint the screen.

John


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]