Inline/OnTheFly convert ?

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
Werty
Posts: 68
Joined: 2010-08-06T05:37:36-07:00
Authentication code: 8675308

Inline/OnTheFly convert ?

Post by Werty » 2010-12-10T14:00:26-07:00

[windows user]

How do I go about changing the format of the input file "on the fly" before outputting it ?

I need something like this...

Convert image.bmp clipboard:

...where the clipboard content should be in 16bit PGM format. Saving to harddisk first is a no go, that's exactly what I'm trying to avoid.

I read in the examples about inline resizing like so "convert image.bmp[120x120] image_resized.png", is there anyway to do the same but for format instead ? like...

convert image.bmp[PGM:] clipboard:
(this obviously doesnt work, but I need something that does)

Thanks
Windows 7 user

User avatar
GreenKoopa
Posts: 457
Joined: 2010-11-04T17:24:08-07:00
Authentication code: 8675308

Re: Inline/OnTheFly convert ?

Post by GreenKoopa » 2010-12-10T16:05:07-07:00

[fellow windows user]

Awesome, I had no idea we could read from and write to the clipboard!

I string together histogram:info: for my output, so I hoped PGM:clipboard: would work. No luck though. PGM:- works, so it doubly seems like it should work.

Hopefully someone has the solution. If not, I wonder if there is a way outside of ImageMagick to capture the output stream and get it to the clipboard like:
convert image.bmp PGM:- > some_clipboard_utility.exe

Werty
Posts: 68
Joined: 2010-08-06T05:37:36-07:00
Authentication code: 8675308

Re: Inline/OnTheFly convert ?

Post by Werty » 2010-12-10T16:18:07-07:00

Yes, using the clipboard is awesome, I found out when trying to find a way to make image blobs work, which I couldnt, so I use clipboard as a workaround.
Please read "our" threads about blobs using the imagemagickObject.dll in the COM API section, link here...
viewtopic.php?f=8&t=12073

If you figure out how to do it (dunno what language you use, I use AutoIt) then PLEASE let us all know :p

As for topic, I already tried and hoped for PGM:clipboard: would work, also PGM:image.bmp clipboard: doesnt work.

I could really use it :p but I'm sure there's an easy way, we just have to wait for fmw42 or anthony to show up :D
Windows 7 user

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

Re: Inline/OnTheFly convert ?

Post by anthony » 2010-12-10T19:00:12-07:00

I am sorry I have not used many examples of clipboard: Mostly because clipboard for images is not available in Linux, which is where my expertise is. It is purely a windows only option.
Anthony Thyssen -- Webmaster for ImageMagick Example Pages
https://imagemagick.org/Usage/

User avatar
GreenKoopa
Posts: 457
Joined: 2010-11-04T17:24:08-07:00
Authentication code: 8675308

Re: Inline/OnTheFly convert ?

Post by GreenKoopa » 2010-12-10T19:21:21-07:00

anthony wrote: I am sorry I have not used many examples of clipboard:
Simply listing it with the others at http://www.imagemagick.org/Usage/files/#special_formats would have let me known it existed.
anthony wrote: Mostly because clipboard for images is not available in Linux, which is where my expertise is. It is purely a windows only option.
Which is why I'm surprised and delighted this even exists.
Werty wrote:(dunno what language you use, I use AutoIt)
AutoHotkey is the closest I've come to AutoIt. For the month I have been playing with ImageMagick, I have relied on simple batch files. I'm playing with Strawberry Perl now.

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

Re: Inline/OnTheFly convert ?

Post by anthony » 2010-12-10T19:23:30-07:00

If someone likes to write a small blurb, for clipboard: I'll add it there.
Anthony Thyssen -- Webmaster for ImageMagick Example Pages
https://imagemagick.org/Usage/

User avatar
GreenKoopa
Posts: 457
Joined: 2010-11-04T17:24:08-07:00
Authentication code: 8675308

Re: Inline/OnTheFly convert ?

Post by GreenKoopa » 2010-12-11T00:45:36-07:00

anthony wrote:If someone likes to write a small blurb, for clipboard: I'll add it there.
Since I just learned of it, Werty is probably more knowledgeable. Listing it and stating it is exclusive to Windows would be progress. Are there any informative comments in the code?

Werty
Posts: 68
Joined: 2010-08-06T05:37:36-07:00
Authentication code: 8675308

Re: Inline/OnTheFly convert ?

Post by Werty » 2010-12-11T03:50:49-07:00

GreenKoopa wrote: Simply listing it with the others at http://www.imagemagick.org/Usage/files/#special_formats would have let me known it existed.
It's listed here...
http://www.imagemagick.org/script/forma ... dmrabmr645
(Scroll down to pseudo image formats)

I would love to get "win:" working :p
Windows 7 user

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

Re: Inline/OnTheFly convert ?

Post by anthony » 2010-12-11T19:19:01-07:00

win: is a output only special format, like x: and show: (show calls "display" as a background process, so the main command can continue).

In what way does win: not work?
Anthony Thyssen -- Webmaster for ImageMagick Example Pages
https://imagemagick.org/Usage/

User avatar
GreenKoopa
Posts: 457
Joined: 2010-11-04T17:24:08-07:00
Authentication code: 8675308

Re: Inline/OnTheFly convert ?

Post by GreenKoopa » 2010-12-11T19:34:26-07:00

Werty wrote: I would love to get "win:" working :p
anthony wrote: In what way does win: not work?
Just to validate Werty, it doesn't work for me either.
convert 1a.png win:
convert.exe: `%s' (%d) imdisplay.exe "C:/Users/user/AppData/Local/Temp/magick-OwUXDBzZ." @ error/utility.c/SystemCommand/2093.
convert.exe: Delegate failed `imdisplay.exe "%i."' @ error/delegate.c/InvokeDelegate/1061.

Werty
Posts: 68
Joined: 2010-08-06T05:37:36-07:00
Authentication code: 8675308

Re: Inline/OnTheFly convert ?

Post by Werty » 2010-12-11T20:29:50-07:00

anthony wrote:win: is a output only special format, like x: and show: (show calls "display" as a background process, so the main command can continue).

In what way does win: not work?
In the description it says, WIN RW "Select image from or display image to your computer screen", so unless that's wrong, it should be able to both capture and show images from a defined window, but I cant get it to do either, GreenKoopa appears to have trouble also.
Windows 7 user

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

Re: Inline/OnTheFly convert ?

Post by anthony » 2010-12-12T00:52:04-07:00

That sounds more like a description for X:, but then I don't know win:

Hmm the official description is just.... Only supported under Microsoft Windows.

While the description for clipboard is Only available under Microsoft Windows.

The IM Usage examples lists it with show: and says...
These are special output formats that will which will directly display
the image result to your screen. Instead of saving the image into a file,
it just displays the result.


So where does it say that? I assume in the "-list format" output.
It it is not doing that then it probably should be reported as a bug of some kind.
Anthony Thyssen -- Webmaster for ImageMagick Example Pages
https://imagemagick.org/Usage/

Werty
Posts: 68
Joined: 2010-08-06T05:37:36-07:00
Authentication code: 8675308

Re: Inline/OnTheFly convert ?

Post by Werty » 2010-12-12T01:50:03-07:00

anthony wrote:
So where does it say that?
It says it here, same link as I posted above.

http://www.imagemagick.org/script/forma ... dmrabmr645
(Scroll down to pseudo image formats)
Windows 7 user

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

Re: Inline/OnTheFly convert ?

Post by anthony » 2010-12-12T04:51:02-07:00

Oh yes. looking at the wrong column.

Okay report a bug. specifying exactly what you tried.
Anthony Thyssen -- Webmaster for ImageMagick Example Pages
https://imagemagick.org/Usage/

Werty
Posts: 68
Joined: 2010-08-06T05:37:36-07:00
Authentication code: 8675308

Re: Inline/OnTheFly convert ?

Post by Werty » 2010-12-15T16:56:24-07:00

Ah, well, found the answer :(
viewtopic.php?f=1&t=10757&p=34128&hilit=win%3A#p34128
magick wrote:ImageMagick does not permit native Window screen captures, it only captures a screen under Windows if you are running an X11 server.
I still need my original problem solved though :p
Windows 7 user

Post Reply