looking for docs for PRINT command

Questions and postings pertaining to the usage of ImageMagick regardless of the interface. This includes the command-line utilities, as well as the C and C++ APIs. Usage questions are like "How do I use ImageMagick to create drop shadows?".
Post Reply
holden
Posts: 79
Joined: 2013-02-07T08:22:57-07:00
Authentication code: 6789

looking for docs for PRINT command

Post by holden »

The only place I've been able to find anything is here:
https://www.imagemagick.org/script/formats.php
Is there a more comprehensive doc or examples concerning the PRINT function available? Thanks
User avatar
fmw42
Posts: 25562
Joined: 2007-07-02T17:14:51-07:00
Authentication code: 1152
Location: Sunnyvale, California, USA

Re: looking for docs for PRINT command

Post by fmw42 »

What is your IM version and platform? What do you want to print? What was your exact command line apart from the printing? What had you tried.

Imagemagick uses -write to save images. It uses txt: to convert the image to list the pixels. It use -format ... info: to list certain meta data to the terminal.

See https://www.imagemagick.org/Usage/files/ and https://www.imagemagick.org/script/comm ... .php#print
holden
Posts: 79
Joined: 2013-02-07T08:22:57-07:00
Authentication code: 6789

Re: looking for docs for PRINT command

Post by holden »

IM on Windows, whatever version I need to make it happen ;)

from the page I linked:
PRINT Send image to your computer printer Unix users may set the PRINTER (for 'lpr') or LPDEST (for 'lp') environment variables to select the desired printer.
I haven't tried anything yet, just looking for docs to see if printing through IM is a viable option for automation at this point.
User avatar
fmw42
Posts: 25562
Joined: 2007-07-02T17:14:51-07:00
Authentication code: 1152
Location: Sunnyvale, California, USA

Re: looking for docs for PRINT command

Post by fmw42 »

What is you want to print? Pictures or text. If pictures, then just save them to file and use some other tool such as your browser to print them to a printer.

Sorry I have never used that print feature before for printing images. I know of no other documentation for that, but it might exist somewhere. I do not know if that is Windows friendly or not.
snibgo
Posts: 12159
Joined: 2010-01-23T23:01:33-07:00
Authentication code: 1151
Location: England, UK

Re: looking for docs for PRINT command

Post by snibgo »

"-print" is used with a meaning as in C "printf()". It sends text to the console. It isn't concerned with physically printing on paper. "-print XYZ" is short for "-format XYZ -write info:".
snibgo's IM pages: im.snibgo.com
User avatar
fmw42
Posts: 25562
Joined: 2007-07-02T17:14:51-07:00
Authentication code: 1152
Location: Sunnyvale, California, USA

Re: looking for docs for PRINT command

Post by fmw42 »

snibgo wrote: 2018-01-17T15:12:11-07:00 "-print" is used with a meaning as in C "printf()". It sends text to the console. It isn't concerned with physically printing on paper. "-print XYZ" is short for "-format XYZ -write info:".
Those do not work on my Mac (unix). Perhaps I am doing something wrong.


This works:

Code: Select all

convert rose: -format "%wx%h\n" info:
70x46


These do but give error messages:

Code: Select all

convert rose: -format "%wx%h\n" -write info:
70x46
convert: missing an image filename `info:' @ error/convert.c/ConvertImageCommand/3255.

Code: Select all

convert rose: -print "%wx%h\n"
70x46
convert: missing an image filename `%wx%h\n' @ error/convert.c/ConvertImageCommand/3255.
snibgo
Posts: 12159
Joined: 2010-01-23T23:01:33-07:00
Authentication code: 1151
Location: England, UK

Re: looking for docs for PRINT command

Post by snibgo »

What I mean is that anywhere you can put "-format XYZ -write info:", you can instead put "-print XYZ". For example:

Code: Select all

f:\prose\PICTURES>convert rose: -format "%wx%h\n" -write info: x.png
70x46

f:\prose\PICTURES>convert rose: -print "%wx%h\n" x.png
70x46
snibgo's IM pages: im.snibgo.com
User avatar
fmw42
Posts: 25562
Joined: 2007-07-02T17:14:51-07:00
Authentication code: 1152
Location: Sunnyvale, California, USA

Re: looking for docs for PRINT command

Post by fmw42 »

snibgo, thanks for the clarification. I had never used -print before.
holden
Posts: 79
Joined: 2013-02-07T08:22:57-07:00
Authentication code: 6789

Re: looking for docs for PRINT command

Post by holden »

It would seem this is a pretty obscure IM function, I will keep looking for another solution (it is surprisingly hard to find a way to send prints to printers in an automated way).
User avatar
fmw42
Posts: 25562
Joined: 2007-07-02T17:14:51-07:00
Authentication code: 1152
Location: Sunnyvale, California, USA

Re: looking for docs for PRINT command

Post by fmw42 »

I do not think Imagemagick has a direct print to printer command for images.
snibgo
Posts: 12159
Joined: 2010-01-23T23:01:33-07:00
Authentication code: 1151
Location: England, UK

Re: looking for docs for PRINT command

Post by snibgo »

On Unix, printers are devices which are files, so it should be easy, maybe.

On Windows, IrfanView works fine, eg:

Code: Select all

i_view64 toes.png /print
snibgo's IM pages: im.snibgo.com
User avatar
fmw42
Posts: 25562
Joined: 2007-07-02T17:14:51-07:00
Authentication code: 1152
Location: Sunnyvale, California, USA

Re: looking for docs for PRINT command

Post by fmw42 »

User avatar
anthony
Posts: 8883
Joined: 2004-05-31T19:27:03-07:00
Authentication code: 8675308
Location: Brisbane, Australia

Re: looking for docs for PRINT command

Post by anthony »

Also see Identify Output Alternatives...
http://www.imagemagick.org/Usage/basics/#identify_alt
The main difference between "-identify" and "-print", is that first will be run once for every image in memory, while the later will only run once.
Anthony Thyssen -- Webmaster for ImageMagick Example Pages
https://imagemagick.org/Usage/
Post Reply