Output to clipboard

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
Elapido
Posts: 42
Joined: 2011-06-10T14:27:28-07:00
Authentication code: 8675308

Output to clipboard

Post by Elapido »

Can I run identify -format to output the result to the clipboard?

Also, can I use this command to get the area in pixels of the image? I can get something like '640x480', but I'd like: 307200. Is it possible?
User avatar
fmw42
Posts: 25562
Joined: 2007-07-02T17:14:51-07:00
Authentication code: 1152
Location: Sunnyvale, California, USA

Re: Output to clipboard

Post by fmw42 »

I cannot answer the first question, but for the second you can do:

convert yourimage -ping -format "%[fx:w*h]" info:

for example using the rose: IM internal image

convert rose: -ping -format "%[fx:w*h]" info:
3220


the -ping avoids reading the full image so makes it quicker.


see
http://www.imagemagick.org/script/escape.php
http://www.imagemagick.org/Usage/transform/#fx
http://www.imagemagick.org/script/fx.php
http://www.imagemagick.org/Usage/basics/#controls

For windows users, I believe that you need %% rather than %. See http://www.imagemagick.org/Usage/windows/
User avatar
anthony
Posts: 8883
Joined: 2004-05-31T19:27:03-07:00
Authentication code: 8675308
Location: Brisbane, Australia

Re: Output to clipboard

Post by anthony »

First part... YES

Use the special output format clip: that is

Code: Select all

   convert ........... clip:
Anthony Thyssen -- Webmaster for ImageMagick Example Pages
https://imagemagick.org/Usage/
Elapido
Posts: 42
Joined: 2011-06-10T14:27:28-07:00
Authentication code: 8675308

Re: Output to clipboard

Post by Elapido »

How do I get the output in decimal format? With large images I get something like: 1e+006

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

Re: Output to clipboard

Post by anthony »

That is a valid number format, and used for very large numbers. In that case it means 1 million. 1 with 6 digits after the first number.
Anthony Thyssen -- Webmaster for ImageMagick Example Pages
https://imagemagick.org/Usage/
Elapido
Posts: 42
Joined: 2011-06-10T14:27:28-07:00
Authentication code: 8675308

Re: Output to clipboard

Post by Elapido »

I understand, but autohotkey doesn't understand it when doing calculations.
User avatar
anthony
Posts: 8883
Joined: 2004-05-31T19:27:03-07:00
Authentication code: 8675308
Location: Brisbane, Australia

Re: Output to clipboard

Post by anthony »

Type increasing -precision from 6 to 8 to include more significant digits

Code: Select all

convert null: -format '%[fx:1e+6]' info:
1e+06
convert null: -precision 8 -format '%[fx:1e+6]' info:
1000000
Anthony Thyssen -- Webmaster for ImageMagick Example Pages
https://imagemagick.org/Usage/
pipitas
Posts: 168
Joined: 2012-07-15T14:06:46-07:00
Authentication code: 15

Re: Output to clipboard

Post by pipitas »

anthony wrote:First part... YES

Use the special output format clip: that is

Code: Select all

   convert ........... clip:
Am I right in assuming that this no longer works? That the meaning of clip: has changed since the above was written, 4 years ago?
User avatar
dlemstra
Posts: 1570
Joined: 2013-05-04T15:28:54-07:00
Authentication code: 6789
Contact:

Re: Output to clipboard

Post by dlemstra »

clip: is now used to save the clip path of a file, you should use clipboard: instead.
.NET + ImageMagick = Magick.NET https://github.com/dlemstra/Magick.NET, @MagickNET, Donate
pipitas
Posts: 168
Joined: 2012-07-15T14:06:46-07:00
Authentication code: 15

Re: Output to clipboard

Post by pipitas »

dlemstra wrote:clip: is now used to save the clip path of a file, you should use clipboard: instead.
...but 'clipboard:' works only on Windows, not on other OS platforms.
User avatar
dlemstra
Posts: 1570
Joined: 2013-05-04T15:28:54-07:00
Authentication code: 6789
Contact:

Re: Output to clipboard

Post by dlemstra »

It is supported for builds that use X11, check line 234 of screenshot.c
.NET + ImageMagick = Magick.NET https://github.com/dlemstra/Magick.NET, @MagickNET, Donate
Post Reply