Page 1 of 1

Inline/OnTheFly convert ?

Posted: 2010-12-10T14:00:26-07:00
by Werty
[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

Re: Inline/OnTheFly convert ?

Posted: 2010-12-10T16:05:07-07:00
by GreenKoopa
[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

Re: Inline/OnTheFly convert ?

Posted: 2010-12-10T16:18:07-07:00
by Werty
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

Re: Inline/OnTheFly convert ?

Posted: 2010-12-10T19:00:12-07:00
by anthony
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.

Re: Inline/OnTheFly convert ?

Posted: 2010-12-10T19:21:21-07:00
by GreenKoopa
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.

Re: Inline/OnTheFly convert ?

Posted: 2010-12-10T19:23:30-07:00
by anthony
If someone likes to write a small blurb, for clipboard: I'll add it there.

Re: Inline/OnTheFly convert ?

Posted: 2010-12-11T00:45:36-07:00
by GreenKoopa
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?

Re: Inline/OnTheFly convert ?

Posted: 2010-12-11T03:50:49-07:00
by Werty
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

Re: Inline/OnTheFly convert ?

Posted: 2010-12-11T19:19:01-07:00
by anthony
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?

Re: Inline/OnTheFly convert ?

Posted: 2010-12-11T19:34:26-07:00
by GreenKoopa
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.

Re: Inline/OnTheFly convert ?

Posted: 2010-12-11T20:29:50-07:00
by Werty
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.

Re: Inline/OnTheFly convert ?

Posted: 2010-12-12T00:52:04-07:00
by anthony
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.

Re: Inline/OnTheFly convert ?

Posted: 2010-12-12T01:50:03-07:00
by Werty
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)

Re: Inline/OnTheFly convert ?

Posted: 2010-12-12T04:51:02-07:00
by anthony
Oh yes. looking at the wrong column.

Okay report a bug. specifying exactly what you tried.

Re: Inline/OnTheFly convert ?

Posted: 2010-12-15T16:56:24-07:00
by Werty
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