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.
Linux imagemagick based solution to print image as full page
- fmw42
- Posts: 25562
- Joined: 2007-07-02T17:14:51-07:00
- Authentication code: 1152
- Location: Sunnyvale, California, USA
Re: Linux imagemagick based solution to print image as full
I have never used this, but see -page <media> at http://www.imagemagick.org/script/comma ... s.php#page
Re: Linux imagemagick based solution to print image as full
Thanks fmw42,fmw42 wrote: see -page <media>
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
- fmw42
- Posts: 25562
- Joined: 2007-07-02T17:14:51-07:00
- Authentication code: 1152
- Location: Sunnyvale, California, USA
Re: Linux imagemagick based solution to print image as full
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
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
FYI, no imagemagick necessary, merely the following will do exactly what I wanted: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.
Code: Select all
lp -o fitplot file.jpg