From mboxrd@z Thu Jan 1 00:00:00 1970 X-Msuck: nntp://news.gmane.io/gmane.comp.tex.context/79800 Path: news.gmane.org!not-for-mail From: Peter Rolf Newsgroups: gmane.comp.tex.context Subject: Re: drops module (draft) Date: Fri, 07 Dec 2012 12:59:56 +0100 Message-ID: <50C1DA3C.9040902@gmx.net> References: <50C0D0F4.3020806@gmx.net> Reply-To: mailing list for ConTeXt users NNTP-Posting-Host: plane.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit X-Trace: ger.gmane.org 1354881618 18521 80.91.229.3 (7 Dec 2012 12:00:18 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Fri, 7 Dec 2012 12:00:18 +0000 (UTC) To: mailing list for ConTeXt users Original-X-From: ntg-context-bounces@ntg.nl Fri Dec 07 13:00:27 2012 Return-path: Envelope-to: gctc-ntg-context-518@m.gmane.org Original-Received: from balder.ntg.nl ([195.12.62.10]) by plane.gmane.org with esmtp (Exim 4.69) (envelope-from ) id 1TgwbT-0001nG-94 for gctc-ntg-context-518@m.gmane.org; Fri, 07 Dec 2012 13:00:27 +0100 Original-Received: from localhost (localhost [127.0.0.1]) by balder.ntg.nl (Postfix) with ESMTP id 8FB11101FC; Fri, 7 Dec 2012 13:00:14 +0100 (CET) X-Virus-Scanned: Debian amavisd-new at balder.ntg.nl Original-Received: from balder.ntg.nl ([127.0.0.1]) by localhost (balder.ntg.nl [127.0.0.1]) (amavisd-new, port 10024) with LMTP id YT4WdIA2lz72; Fri, 7 Dec 2012 13:00:07 +0100 (CET) Original-Received: from balder.ntg.nl (localhost [IPv6:::1]) by balder.ntg.nl (Postfix) with ESMTP id 9F32910201; Fri, 7 Dec 2012 13:00:07 +0100 (CET) Original-Received: from localhost (localhost [127.0.0.1]) by balder.ntg.nl (Postfix) with ESMTP id 3760710201 for ; Fri, 7 Dec 2012 13:00:06 +0100 (CET) X-Virus-Scanned: Debian amavisd-new at balder.ntg.nl Original-Received: from balder.ntg.nl ([127.0.0.1]) by localhost (balder.ntg.nl [127.0.0.1]) (amavisd-new, port 10024) with LMTP id ayJqPuXWO91i for ; Fri, 7 Dec 2012 13:00:04 +0100 (CET) Original-Received: from filter4-til.mf.surf.net (filter4-til.mf.surf.net [194.171.167.220]) by balder.ntg.nl (Postfix) with ESMTP id CF2B2101FC for ; Fri, 7 Dec 2012 13:00:04 +0100 (CET) Original-Received: from mailout-de.gmx.net (mailout-de.gmx.net [213.165.64.22]) by filter4-til.mf.surf.net (8.14.3/8.14.3/Debian-9.4) with SMTP id qB7C02RQ032142 for ; Fri, 7 Dec 2012 13:00:03 +0100 Original-Received: (qmail invoked by alias); 07 Dec 2012 12:00:02 -0000 Original-Received: from ip-176-198-216-199.unitymediagroup.de (EHLO [192.168.178.3]) [176.198.216.199] by mail.gmx.net (mp020) with SMTP; 07 Dec 2012 13:00:02 +0100 X-Authenticated: #24293357 X-Provags-ID: V01U2FsdGVkX1+VumlBifCVroanOQLCOLDxSuqvMbwErWtPUczi4k UD7HDhI6QYglg5 User-Agent: Mozilla/5.0 (Windows NT 6.1; WOW64; rv:17.0) Gecko/17.0 Thunderbird/17.0 In-Reply-To: X-Enigmail-Version: 1.4.6 X-Y-GMX-Trusted: 0 X-Bayes-Prob: 0.105 (Score 0, tokens from: @@RPTN) X-CanIt-Geo: ip=213.165.64.22; country=DE; latitude=51.0000; longitude=9.0000; http://maps.google.com/maps?q=51.0000,9.0000&z=6 X-CanItPRO-Stream: uu:ntg-context@ntg.nl (inherits from uu:default, base:default) X-Canit-Stats-ID: 0VIwA02d9 - b4962fec671b - 20121207 (trained as not-spam) X-Scanned-By: CanIt (www . roaringpenguin . com) on 194.171.167.220 X-BeenThere: ntg-context@ntg.nl X-Mailman-Version: 2.1.14 Precedence: list List-Id: mailing list for ConTeXt users List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: ntg-context-bounces@ntg.nl Original-Sender: ntg-context-bounces@ntg.nl Xref: news.gmane.org gmane.comp.tex.context:79800 Archived-At: Am 06.12.2012 19:05, schrieb Aditya Mahajan: > On Thu, 6 Dec 2012, Peter Rolf wrote: > >> Hi all, >> >> a first version of the 'drops'-module (MkIV only) is available at >> >> https://www.wuala.com/indiego/public/ConTeXt/drops/?key=caiCGLasLFmJ >> >> >> Taken from the included documentation.. >> [..] >> 'drops' is a small extension for ConTeXt, that allows you to add drop >> shadows to rectangular regions (so called boxshadows). A working >> installation of ImageMagick (IM) is required to create the shadow >> graphics. The supported color spaces are CMYK, RGB and Gray, the file >> formats are limited to PNG and JPG. >> [..] >> Read the manual for detailed information. > > Nice. > >> The attached example is just a small test file for the 'rotation' >> parameter (a compensation for the object rotation, so that the shadow >> stays at the given direction). You will find other examples in the >> documentation and there is also a 'pile' example with the complete >> source. The 'presets' pdf contains the predefined setups for different >> shadow (or frame) types and it's source is a good starting point for >> your own experiments. >> >> This is a first draft, but most things work quite stable. If you want to >> help, test as much as possible. :-) >> >> *You need a recent version of ImageMagick for this module.* > > I always thought that shadows were possible to do in PDF (after all TikZ > does it using some type of PDF primitives). Since you are the PDF > expert, I am interested in knowing why you choose to go the ImageMagic > route. > Because it's relative simple (I use a working function) , fast (in terms of rendering speed) and the footprint of the shadow graphics is not that big (png: one color, only alpha channel differs). Quality is (as you can see) also not an issue. Mh, there is nothing wrong with bitmaps ;-) See Type4/Type5 Shadings (Free-Form Gouraud-Shaded Triangle Meshes) on page 314 of the PDF Reference for the PDF alternative. The problems to solve are the calculation of the mesh points (think about rounded squares) and also to find a proper shading function (which sets the colors). See 'Shadow Internals' at http://www.imagemagick.org/Usage/blur/#shadow%20internals Far from trivial (and I'm only an amateur with limited time). Also: you can 'draw' (command of IM) any shape in IM (SVG paths are supported) and use the 'shadow' function on that. Theoretically you can extent drops to support any shape (path or drawing). That's one reason why I used the more general name 'drops' instead of the currently better fitting 'boxshadow'. The other reason is, that Hans would never use the stupid name 'drops' internally. :-D > In terms of interface, wouldn't it be better if this somehow interfaced > with the background/overlay mechanism. For example, > > \definedropshadow[identifier][...options...] > > which will define an overlay that will call ImageMagic with appropriate > parameters (and caching the results if speed is a concern), > > and then > > \externalfigure[name][background=identifier] > > should draw a dropped shadow around the image > Needs some thinking > Aditya > ___________________________________________________________________________________ > > If your question is of interest to others as well, please add an entry > to the Wiki! > > maillist : ntg-context@ntg.nl / > http://www.ntg.nl/mailman/listinfo/ntg-context > webpage : http://www.pragma-ade.nl / http://tex.aanhet.net > archive : http://foundry.supelec.fr/projects/contextrev/ > wiki : http://contextgarden.net > ___________________________________________________________________________________ > > ___________________________________________________________________________________ If your question is of interest to others as well, please add an entry to the Wiki! maillist : ntg-context@ntg.nl / http://www.ntg.nl/mailman/listinfo/ntg-context webpage : http://www.pragma-ade.nl / http://tex.aanhet.net archive : http://foundry.supelec.fr/projects/contextrev/ wiki : http://contextgarden.net ___________________________________________________________________________________