Page 1 of 1
Linux imagemagick based solution to print image as full page
Posted: 2011-07-04T18:47:34-07:00
by xpt
Hi,
As titled, I'm looking for a imagemagick based solution to print an arbitrary image on a full legal/A4 page under Linux, and better just the image, no any headers and footers.
I've searched it myself, but bits and pieces of info here and there on the web about DPI, density, etc just doesn't paint a whole picture for me. Please help (better cover both horizontal and portrait cases).
Thanks.
Re: Linux imagemagick based solution to print image as full
Posted: 2011-07-04T19:36:07-07:00
by fmw42
Re: Linux imagemagick based solution to print image as full
Posted: 2011-07-04T20:08:39-07:00
by xpt
fmw42 wrote: see -page <media>
Thanks fmw42,
Hmm, -page <media> will "set the size and location of an image on the larger virtual canvas", and "is used in concert with -density". I believe that DPI is also a concern as well.
So, say my picture is of size 1600x1200, to enable printing to Letter size full page (which is 792x612, landscape), what shall I do? Further, how can I print it? ie, can the converted result be directly printed with the display command onto Letter size page in full? Or, to convert to ps/pdf files, I read that there has been problems with the bonding box or something, is it now fixed?
thanks
Re: Linux imagemagick based solution to print image as full
Posted: 2011-07-04T20:22:35-07:00
by fmw42
sorry I really don't know much about printing.
density and DPI are the same. IM use -density to set the dpi. IM does not do any printing to my knowledge. You have to set the density appropriately or use -page <media> to do it (perhaps, I don't know). Then send the image to your printer using your print command on your computer or other imaging application.
Density is dots (pixels) per inch. So you need to know how big your page is in inches. The divide the pixels in the image by the inches in both width and height.
So say a legal page is 14 x 11 (landscape) and your image is 1600 x 1200. Then your would set your density to 1600/14 x 1200/11 (whatever those division amount to). So
convert image -density 114x109 -units pixels-per-inch resultimage
unless your have a vector image i.e pdf/postscript image, then
convert -density 114x109 -units pixels-per-inch image resultimage
see
http://www.imagemagick.org/Usage/formats/#ps
Re: Linux imagemagick based solution to print image as full
Posted: 2011-07-05T19:11:30-07:00
by xpt
xpt wrote:As titled, I'm looking for a Linux based solution to print an arbitrary image on a full page, and better just the image, no any headers and footers.
FYI, no imagemagick necessary, merely the following will do exactly what I wanted: