From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: joakim@verona.se Newsgroups: gmane.emacs.devel Subject: Re: fast image paging Date: Wed, 13 Nov 2013 19:41:23 +0100 Message-ID: References: <87mwlabt0w.fsf@happiness.m.enhanced.com> NNTP-Posting-Host: plane.gmane.org Mime-Version: 1.0 Content-Type: text/plain X-Trace: ger.gmane.org 1384368111 12292 80.91.229.3 (13 Nov 2013 18:41:51 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Wed, 13 Nov 2013 18:41:51 +0000 (UTC) Cc: Camm Maguire , emacs-devel@gnu.org To: Stefan Monnier Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Wed Nov 13 19:41:56 2013 Return-path: Envelope-to: ged-emacs-devel@m.gmane.org Original-Received: from lists.gnu.org ([208.118.235.17]) by plane.gmane.org with esmtp (Exim 4.69) (envelope-from ) id 1VgfNz-0006ef-Vt for ged-emacs-devel@m.gmane.org; Wed, 13 Nov 2013 19:41:56 +0100 Original-Received: from localhost ([::1]:50213 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1VgfNz-0007GL-Be for ged-emacs-devel@m.gmane.org; Wed, 13 Nov 2013 13:41:55 -0500 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:57807) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1VgfNr-0007G3-4g for emacs-devel@gnu.org; Wed, 13 Nov 2013 13:41:52 -0500 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1VgfNl-0000e8-M0 for emacs-devel@gnu.org; Wed, 13 Nov 2013 13:41:47 -0500 Original-Received: from mx1.bahnhof.se ([213.80.101.11]:53058) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1VgfNl-0000dt-Fm for emacs-devel@gnu.org; Wed, 13 Nov 2013 13:41:41 -0500 Original-Received: from localhost (mf.bahnhof.se [213.80.101.20]) by mx1-reinject (Postfix) with ESMTP id E67998AC391; Wed, 13 Nov 2013 19:41:38 +0100 (CET) X-Virus-Scanned: by amavisd-new using ClamAV at bahnhof.se (MF4) Original-Received: from mf4.bahnhof.se ([127.0.0.1]) by localhost (mf4.bahnhof.se [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id hHohf6QWytHp; Wed, 13 Nov 2013 19:41:35 +0100 (CET) Original-Received: from mta.verona.se (h-235-102.a149.priv.bahnhof.se [85.24.235.102]) by mf4.bahnhof.se (Postfix) with ESMTP id C317B3D7817; Wed, 13 Nov 2013 19:41:34 +0100 (CET) Original-Received: from localhost (unknown [127.0.0.1]) by mta.verona.se (Postfix) with ESMTP id 616F34FC5E6; Wed, 13 Nov 2013 18:41:24 +0000 (UTC) X-Virus-Scanned: amavisd-new at verona.se Original-Received: from mta.verona.se ([127.0.0.1]) by localhost (exodia.verona.se [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id tiYgx5rOHj4I; Wed, 13 Nov 2013 19:41:23 +0100 (CET) Original-Received: from exodia.verona.se (www.verona.se [192.168.200.15]) by mta.verona.se (Postfix) with ESMTP id 6FBB74FC5E0; Wed, 13 Nov 2013 19:41:23 +0100 (CET) In-Reply-To: (Stefan Monnier's message of "Wed, 13 Nov 2013 11:49:23 -0500") User-Agent: Gnus/5.130006 (Ma Gnus v0.6) Emacs/24.3.50 (gnu/linux) X-detected-operating-system: by eggs.gnu.org: Mac OS X 10.x X-Received-From: 213.80.101.11 X-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "Emacs development discussions." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Original-Sender: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.devel:165237 Archived-At: Stefan Monnier writes: >> Greetings! I have a djvu mode which is designed for scholars reading, >> annotating, and cross-referencing many large documents. Right now I use >> pbm formats and create-image. This makes it easy to highlight and >> correlate pixels with text, but the images can get quite large, making >> handling sluggish on slower machines. > >> Will I improve anything here using a compressed format like png? Or, >> when emacs displays and moves the image, does it decompress the image >> anyway into the same sized internal data structure? > > I don't know the precise details, but I think that if you use PNG you > won't gain much because indeed, the png library will begin by > decompressing the image and keeping it that way in memory. > > You might have better luck if you use the `imagemagick' image type, > which might be able to render dejavu directly (i.e. without going > through pbm/png/...), so only the current page is kept in decompressed > bitmap form. FYI I made the original Imagemagick patch for Emacs specifically for working with Djvu in Emacs. I used it for scanning lots images with this elisp: https://github.com/jave/emsane described here http://www.verona.se/projects/emsane.html I used it to archive about 200K djvu pages, much of it previewed in Emacs. Anyway, I think the point I'm trying to make is that the Imagemagick support works pretty well for Djvu. It's also true that there are some deeply hidden knobs in Imagemagick that you might need to twist in order to make it work well in your case. > IIRC last time someone tried to use it there were some problems > (performance, maybe?). Those problems may have been fixed since, > I can't remember. It's definitely worth a try, I think, tho. > > And I'd be very happy to see your mode in GNU ELPA, so if you're > interested in submitting it for inclusion, send me an email, > > > Stefan > -- Joakim Verona