RSS/Atom feed Twitter
Site is read-only, email is disabled

Outputting image

This discussion is connected to the gimp-user-list.gnome.org mailing list which is provided by the GIMP developers and not related to gimpusers.com.

This is a read-only list on gimpusers.com so this discussion thread is read-only, too.

5 of 5 messages available
Toggle history

Please log in to manage your subscriptions.

Outputting image Kate T. Yoak 16 Jan 18:44
  Outputting image Mark J. Reed 16 Jan 19:07
   Outputting image Kate T. Yoak 16 Jan 20:52
    Outputting image Mark J. Reed 16 Jan 21:41
  Outputting image Owen 17 Jan 00:18
Kate T. Yoak
2009-01-16 18:44:52 UTC (about 16 years ago)

Outputting image

Hi there,

Here is another interesting question: is it possible to get the image data out somewhere other than disk? I attempted specifying piped name for image, "|out.pl" , for instance. It simply escapes the pipe and creates a file by that name! Funny. :-)

Once I have Gimp::Image, I would love get the binary data that is the image and do with it as I please.

Anybody done this?

Cheers, Kate

Mark J. Reed
2009-01-16 19:07:56 UTC (about 16 years ago)

Outputting image

On Fri, Jan 16, 2009 at 12:44 PM, Kate T. Yoak wrote:

Here is another interesting question: is it possible to get the image data out somewhere other than disk?

Not by typing something funky in the save-as field. You could always make a named pipe, I suppose:

$ mknod pipe.gif p $ out.pl < pipe.gif

That will block trying to read the pipe; go to gimp and save the image to "pipe.gif" and then out.pl will start getting data...

I attempted specifying piped name for image, "|out.pl" , for instance. It simply escapes the pipe and creates a file by that name! Funny. :-)

There's no "escaping" required. UNIX filenames can have pipes, greater-than signs, dollar signs, etc; the only two byte values that aren't allowed in a UNIX filename are zero and '/'. It's only the shell that adds special meaning to those other characters, and the shell is not involved with Gimp's saving of an image.

Once I have Gimp::Image, I would love get the binary data that is the image and do with it as I please.

Well, the binary image data doesn't exist in gimp's memory in that form; it's created by the save handler for the particular file format. I don't know if there's a way in script-fu (Scheme, Perl, or other) to have the save handler 'save' to something other than a file; someone else may have a better pointer there.

Kate T. Yoak
2009-01-16 20:52:22 UTC (about 16 years ago)

Outputting image

Not by typing something funky in the save-as field. You could always make a named pipe, I suppose:

$ mknod pipe.gif p $ out.pl < pipe.gif

That will block trying to read the pipe; go to gimp and save the image to "pipe.gif" and then out.pl will start getting data...

This is neat. Never encountered mknod . Thanks for passing along something this useful!

Mark J. Reed
2009-01-16 21:41:48 UTC (about 16 years ago)

Outputting image

On Fri, Jan 16, 2009 at 2:52 PM, Kate T. Yoak wrote:

$ mknod pipe.gif p
$ out.pl < pipe.gif

This is neat. Never encountered mknod . Thanks for passing along something this useful!

Ah, named pipes can be quite useful, mostly for one-off situations where there's a better solution that just isn't in place yet. Note that mknod is primarily for device files and doesn't actually support the "p" type for named papes on all systems; if you find one where "mknod blah p" doesn't work, try "mkfifo blah".

Owen
2009-01-17 00:18:55 UTC (about 16 years ago)

Outputting image

On Fri, 16 Jan 2009 09:44:52 -0800 "Kate T. Yoak" wrote:

Hi there,

Here is another interesting question: is it possible to get the image data out somewhere other than disk? I attempted specifying piped name for image, "|out.pl" , for instance. It simply escapes the pipe and creates a file by that name! Funny. :-)

Once I have Gimp::Image, I would love get the binary data that is the image and do with it as I please.

Sort of not with you as to exactly what you want to do, but can you save it in the native format, xcf?

If so look at the specs in devel-docs/xcf.txt of the source for all the bits you can dream of

Owen