From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Stefan Monnier Newsgroups: gmane.emacs.devel Subject: Re: Drawing in images? Date: Tue, 25 Aug 2009 21:07:07 -0400 Message-ID: References: NNTP-Posting-Host: lo.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Trace: ger.gmane.org 1251248853 17893 80.91.229.12 (26 Aug 2009 01:07:33 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Wed, 26 Aug 2009 01:07:33 +0000 (UTC) Cc: Emacs Development To: joakim@verona.se Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Wed Aug 26 03:07:26 2009 Return-path: Envelope-to: ged-emacs-devel@m.gmane.org Original-Received: from lists.gnu.org ([199.232.76.165]) by lo.gmane.org with esmtp (Exim 4.50) id 1Mg6yx-0002KQ-Al for ged-emacs-devel@m.gmane.org; Wed, 26 Aug 2009 03:07:23 +0200 Original-Received: from localhost ([127.0.0.1]:42479 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1Mg6yv-000238-I9 for ged-emacs-devel@m.gmane.org; Tue, 25 Aug 2009 21:07:21 -0400 Original-Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1Mg6yo-00022j-Pj for emacs-devel@gnu.org; Tue, 25 Aug 2009 21:07:14 -0400 Original-Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1Mg6yj-0001zS-SI for emacs-devel@gnu.org; Tue, 25 Aug 2009 21:07:14 -0400 Original-Received: from [199.232.76.173] (port=49970 helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1Mg6yj-0001zM-Om for emacs-devel@gnu.org; Tue, 25 Aug 2009 21:07:09 -0400 Original-Received: from ironport2-out.pppoe.ca ([206.248.154.182]:47430 helo=ironport2-out.teksavvy.com) by monty-python.gnu.org with esmtp (Exim 4.60) (envelope-from ) id 1Mg6yj-0004Gm-CX for emacs-devel@gnu.org; Tue, 25 Aug 2009 21:07:09 -0400 X-IronPort-Anti-Spam-Filtered: true X-IronPort-Anti-Spam-Result: AooFAJMnlEpFpYuS/2dsb2JhbACBU9ZfhBoFh2I X-IronPort-AV: E=Sophos;i="4.44,275,1249272000"; d="scan'208";a="44182835" Original-Received: from 69-165-139-146.dsl.teksavvy.com (HELO pastel.home) ([69.165.139.146]) by ironport2-out.teksavvy.com with ESMTP; 25 Aug 2009 21:06:16 -0400 Original-Received: by pastel.home (Postfix, from userid 20848) id AE7D07F42; Tue, 25 Aug 2009 21:07:07 -0400 (EDT) In-Reply-To: (joakim@verona.se's message of "Wed, 26 Aug 2009 00:57:17 +0200") User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/23.1.50 (gnu/linux) X-detected-operating-system: by monty-python.gnu.org: Genre and OS details not recognized. X-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "Emacs development discussions." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Original-Sender: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Errors-To: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.devel:114601 Archived-At: > a) use clever already existing way, unknown to me, or > b) patch my imagemagic patch to support drawing operations within > images displayed in Emacs, or > c) non-existing way likelier to be accepted in Emacs, than b)? > The use-case is displaying a scanned image and selecting a region for > OCR, which will result in text that will later be processed in Emacs. doc-view-set-slice-using-mouse would also like such a thing, so you can view the rectangle to which you want to crop the document. I don't think `a' exists (well, you can probably do it by running ImageMagick somehow and/or construct an XPM or SVG data stream in Elisp, ... pretty messy and likely to be slow). As for whether `b' or `c' would be preferred, it all depends: in general, I'd prefer if it worked independently from the backend image library, so `c' would be the favorite, but I might still prefer a clean `b' than a messy `c'. Maybe a good way to do it would be to allow stacking images (in your case, the bottom one could use any image library, and the top one could use SVG to draw the region boundary). Stefan