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

GimpImage to GdkPixbuf

This discussion is connected to the gimp-developer-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.

8 of 8 messages available
Toggle history

Please log in to manage your subscriptions.

GimpImage to GdkPixbuf Aurimas Juška 22 Mar 11:02
  GimpImage to GdkPixbuf Michael Natterer 22 Mar 17:42
   GimpImage to GdkPixbuf Aurimas Juška 23 Mar 09:45
    GimpImage to GdkPixbuf Michael Natterer 23 Mar 15:20
     GimpImage to GdkPixbuf Aurimas Juška 23 Mar 16:46
      GimpImage to GdkPixbuf Michael Natterer 23 Mar 17:47
    GimpImage to GdkPixbuf Sven Neumann 23 Mar 19:22
     GimpImage to GdkPixbuf Aurimas Juška 02 Apr 16:41
Aurimas Juška
2007-03-22 11:02:36 UTC (about 17 years ago)

GimpImage to GdkPixbuf

Hi,

What's the best way to render gimp image to GdkPixbuf (which in turn can be rendered to GdkWindow)? The GdkPixbuf would contain the same pixels as if they were rendered with Gimp on GdkWindow (display filters, color management, etc). In other words, it should "pre-bake" this stuff. Is it possible to do that?

Thanks.

Michael Natterer
2007-03-22 17:42:29 UTC (about 17 years ago)

GimpImage to GdkPixbuf

On Thu, 2007-03-22 at 12:02 +0200, Aurimas Juška wrote:

Hi,

What's the best way to render gimp image to GdkPixbuf (which in turn can be rendered to GdkWindow)? The GdkPixbuf would contain the same pixels as if they were rendered with Gimp on GdkWindow (display filters, color management, etc). In other words, it should "pre-bake" this stuff. Is it possible to do that?

I would say making a screenshot and loading the resulting file with gdk_pixbuf_new_from_file() is probably the easiest way.

ciao, --mitch

Aurimas Juška
2007-03-23 09:45:39 UTC (about 17 years ago)

GimpImage to GdkPixbuf

On 3/22/07, Michael Natterer wrote:

I would say making a screenshot and loading the resulting file with gdk_pixbuf_new_from_file() is probably the easiest way.

I would like to implement something like GdkPixbuf gimp_image_render_gdk_pixbuf (GimpImage) or even more general
void gimp_image_render_gdk_drawable (GimpImage, GdkDrawable) correctly (with display filters, color management, etc). This would probably be easier to be done in the core, though.

If screenshot is an option to implement it, could you tell me how can I take screenshot of image which is, for example, too large to fit in a window?

Michael Natterer
2007-03-23 15:20:31 UTC (about 17 years ago)

GimpImage to GdkPixbuf

On Fri, 2007-03-23 at 10:45 +0200, Aurimas Juška wrote:

On 3/22/07, Michael Natterer wrote:

I would say making a screenshot and loading the resulting file with gdk_pixbuf_new_from_file() is probably the easiest way.

I would like to implement something like GdkPixbuf gimp_image_render_gdk_pixbuf (GimpImage) or even more general
void gimp_image_render_gdk_drawable (GimpImage, GdkDrawable) correctly (with display filters, color management, etc). This would probably be easier to be done in the core, though.

If screenshot is an option to implement it, could you tell me how can I take screenshot of image which is, for example, too large to fit in a window?

It's of course only a workaround.

I've thought again about that request, and I think you have a point. Color management actually *is* a display filter, so what's needed is simply to be able to "copy visible" with display filters applied.

Since "copy visible" IMHO implies this (but in fact doesn't do it), would you please file a bug report about it? It should probably be a different function, since display filters are per *display*, while copy visible copies from the projection, which is part of the image (and should probably stay part of the image).

I could imagine just another "copy " function that does this. You could then simply paste the buffer as new image and save it. An in-core pixbuf wouldn't help you anyway, you want the pixels in a file anyway to be able to use them.

ciao, --mitch

Aurimas Juška
2007-03-23 16:46:51 UTC (about 17 years ago)

GimpImage to GdkPixbuf

On 3/23/07, Michael Natterer wrote:

I could imagine just another "copy " function that does this. You could then simply paste the buffer as new image and save it. An in-core pixbuf wouldn't help you anyway, you want the pixels in a file anyway to be able to use them.

We don't understand each other. I want in-memory GdkPixbuf (not files). I want to know how I could hack a function in my plugin that does this.

Michael Natterer
2007-03-23 17:47:10 UTC (about 17 years ago)

GimpImage to GdkPixbuf

On Fri, 2007-03-23 at 17:46 +0200, Aurimas Juška wrote:

On 3/23/07, Michael Natterer wrote:

I could imagine just another "copy " function that does this. You could then simply paste the buffer as new image and save it. An in-core pixbuf wouldn't help you anyway, you want the pixels in a file anyway to be able to use them.

We don't understand each other. I want in-memory GdkPixbuf (not files). I want to know how I could hack a function in my plugin that does this.

I think we do understand each other :) The new function i propose would be PDB-accessible and you could simply get the buffer and put it into a pixbuf. A GIMP-internal pixbuf doesn't help unless you want to maintain a hacked GIMP version which includes your changes.

ciao,
--mitch

Sven Neumann
2007-03-23 19:22:25 UTC (about 17 years ago)

GimpImage to GdkPixbuf

Hi,

On Fri, 2007-03-23 at 10:45 +0200, Aurimas Juška wrote:

I would like to implement something like GdkPixbuf gimp_image_render_gdk_pixbuf (GimpImage) or even more general
void gimp_image_render_gdk_drawable (GimpImage, GdkDrawable) correctly (with display filters, color management, etc).

What you are asking for is currently not possible. There are some ways to get something close though. It would help a lot if you could explain what exactly you want to achieve. We could then see if there are already ways to do that or if a new API is needed.

Sven

Aurimas Juška
2007-04-02 16:41:39 UTC (about 17 years ago)

GimpImage to GdkPixbuf

On 3/23/07, Sven Neumann wrote:

What you are asking for is currently not possible. There are some ways to get something close though. It would help a lot if you could explain what exactly you want to achieve. We could then see if there are already ways to do that or if a new API is needed.

The first idea was that you can render all pixels of image on GdkPixbuf once, and then it is very easy (and both fast) to display GdkPixbuf zoomed, scrolled, etc, on GdkWindow. (Eliminate complexity and add flexibility :)

I know that this approach wouldn't work for very large images and it is not useful for everyone, so I thought of something more general:

gboolean gimp_image_render_to_drawable( GimpImage image, GdkDrawable *drawable, int dest_x, int dest_y, int dest_width, int dest_height, double offset_x, double offset_y, double scale_x, double scale_y, int overall_alpha, int check_x, int check_y, int check_size, guint32 color1, guint32 color2);

(most arguments mean the same as in gdk_pixbuf_composite_color()). This would render gimp image (whole or part) on GdkPixbuf or GdkWindow, which should be enough to meat any rendering needs on custom widgets.