> Date: Mon, 26 Jun 2006 14:05:18 +0200 (CEST)
> From: Helmut Jarausch <[EMAIL PROTECTED]>
> Sender: [EMAIL PROTECTED]
> 
> Hi,
> 
> this must be FAQ, still I haven't found the answer.
> 
> I want to display an image (i.e. a jpeg file) and want it scaled
> such that the whole image fits to the current (X-)window.
> 
> What option of 'display' achieves this?
> 
> Many thanks for a hint,

Actually, this is documented in the over-all ImageMagick section as it
is not exclusive to display(1). It's a standard option common to all IM
command where sizing is relevant. It does require that you know the
desired window size.

display -resize X_SIZExY_SIZE> IMAGE
where "X_SIZE" is the window width and "Y_SIZE" is the window height in
pixels. "IMAGE" is the file to be displayed. The '>' tells IM to resize
the image to be no larger than the specified size while maintaining
aspect ratio. If you also want smaller images resized larger, simply
don't include the '>'.

Note that '>' is a significant character to most shells, so will
probably need to be escaped.

display -resize "1016x740>" my-image.jpg (1024x768 display)
display -resize 1272x996\> another-image.png (1280x1024 display)

Note that the numbers are reduced to allow for the window
decorations. Further reductions may be required to avoid menus and the
like. Escaping characters in a script get a bit messy. In a Perl script,
I use: `display -geometry +0+0 -resize 1372x1020\\\> $display_list`
-- 
R. Kevin Oberman, Network Engineer
Energy Sciences Network (ESnet)
Ernest O. Lawrence Berkeley National Laboratory (Berkeley Lab)
E-mail: [EMAIL PROTECTED]                       Phone: +1 510 486-8634
_______________________________________________
Magick-users mailing list
[email protected]
http://studio.imagemagick.org/mailman/listinfo/magick-users

Reply via email to