[Dev-luatex] How to crop bitmap images

Hans Hagen pragma at wxs.nl
Mon Jul 1 14:32:11 CEST 2013


On 7/1/2013 1:51 PM, Patrick Gundlach wrote:
> Hi,
>
> I'd like to crop a bitmap image. How? This is my code for image inclusion:
>
> -------
> \directlua{
>    image = img.scan{filename="hacker.jpg"}
>    tex.box[0] = node.hpack(img.node(image))
> }
>
> \box0
> -------
>
> bbox{...} seems to work only with PDF images.

use the pdf clip operator i.e. set a path with 'l' and 'm' and then 
apply the operator 'W n'

Hans


-----------------------------------------------------------------
                                           Hans Hagen | PRAGMA ADE
               Ridderstraat 27 | 8061 GH Hasselt | The Netherlands
     tel: 038 477 53 69 | voip: 087 875 68 74 | www.pragma-ade.com
                                              | www.pragma-pod.nl
-----------------------------------------------------------------


More information about the dev-luatex mailing list