Gimp.Layer.new_from_pixbuf
function new_from_pixbuf(image: Gimp.Image, name: String, pixbuf: GdkPixbuf.Pixbuf, opacity: Number(gdouble), mode: Gimp.LayerMode, progress_start: Number(gdouble), progress_end: Number(gdouble)): Gimp.Layer {
// Gjs wrapper for gimp_layer_new_from_pixbuf()
}
Create a new layer from a %GdkPixbuf.
This procedure creates a new layer from the given %GdkPixbuf. The image has to be an RGB image and just like with Gimp.Layer.new you will still need to add the layer to it.
If you pass progress_end > progress_start to this function, Gimp.progress_update will be called for. You have to call Gimp.progress_init beforehand then.
Since 2.2
- image
The RGB image to which to add the layer.
- name
The layer name.
- pixbuf
A GdkPixbuf.
- opacity
The layer opacity.
- mode
The layer combination mode.
- progress_start
start of progress
- progress_end
end of progress
- Returns
The newly created layer. The object belongs to libgimp and you should not free it.