Upload files to "python-fu-instagram-1977"
This commit is contained in:
@@ -15,11 +15,6 @@ import os, sys, string, tempfile, platform
|
|||||||
gi.require_version('Gegl', '0.4')
|
gi.require_version('Gegl', '0.4')
|
||||||
from gi.repository import Gegl
|
from gi.repository import Gegl
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
RGB_MODE = Gimp.LayerCompositeMode.AUTO
|
|
||||||
NORMAL_MODE = Gimp.LayerMode.NORMAL
|
|
||||||
|
|
||||||
class PythonInstagram1977(Gimp.PlugIn):
|
class PythonInstagram1977(Gimp.PlugIn):
|
||||||
## GimpPlugIn virtual methods ##
|
## GimpPlugIn virtual methods ##
|
||||||
def do_set_i18n(self, procname):
|
def do_set_i18n(self, procname):
|
||||||
@@ -57,21 +52,23 @@ class PythonInstagram1977(Gimp.PlugIn):
|
|||||||
drawCopy = Gimp.Layer.new_from_drawable(drawables[0],img)
|
drawCopy = Gimp.Layer.new_from_drawable(drawables[0],img)
|
||||||
img.insert_layer(drawCopy,lg,0)
|
img.insert_layer(drawCopy,lg,0)
|
||||||
#adjust curves colors
|
#adjust curves colors
|
||||||
drawCopy.curves_spline(0,(0,60, 65,70, 255,255) )
|
drawCopy.curves_spline(Gimp.HistogramChannel.ALPHA,(0,60, 65,70, 255,255) )
|
||||||
Gimp.Selection.all(img)
|
Gimp.Selection.all(img)
|
||||||
|
|
||||||
sel_size = Gimp.Selection.bounds(img)
|
sel_size = Gimp.Selection.bounds(img)
|
||||||
w = sel_size.x2 - sel_size.x1
|
w = sel_size.x2 - sel_size.x1
|
||||||
h = sel_size.y2 - sel_size.y1
|
h = sel_size.y2 - sel_size.y1
|
||||||
|
|
||||||
l = Gimp.Layer.new(img,"1977Col",w,h,RGB_MODE,100,Gimp.LayerMode.DARKEN_ONLY)
|
l = Gimp.Layer.new(img,"1977Col",w,h,Gimp.ImageType.RGBA_IMAGE,100.0,Gimp.LayerMode.DARKEN_ONLY)
|
||||||
img.insert_layer(l, lg,0)
|
img.insert_layer(l, lg,0)
|
||||||
color = Gegl.Color.new("rgb(227,255,215)")
|
color = Gegl.Color.new("rgba(227,255,215,0)")
|
||||||
Gimp.context_set_foreground(color)
|
Gimp.context_set_foreground(color)
|
||||||
l.edit_fill(Gimp.FillType.FOREGROUND)
|
l.edit_fill(Gimp.FillType.FOREGROUND)
|
||||||
|
l.set_mode(Gimp.LayerMode.DARKEN_ONLY)
|
||||||
|
|
||||||
Gimp.Selection.none(img)
|
Gimp.Selection.none(img)
|
||||||
#add white border
|
#add white border
|
||||||
Wborder = Gimp.Layer.new(img,"whiteBorder",w,h,RGB_MODE,100,NORMAL_MODE)
|
Wborder = Gimp.Layer.new(img,"whiteBorder",w,h,Gimp.ImageType.RGBA_IMAGE,100.0,Gimp.LayerMode.NORMAL)
|
||||||
img.insert_layer(Wborder, lg, 0)
|
img.insert_layer(Wborder, lg, 0)
|
||||||
wcolor = Gegl.Color.new("white")
|
wcolor = Gegl.Color.new("white")
|
||||||
Gimp.context_set_foreground(wcolor)
|
Gimp.context_set_foreground(wcolor)
|
||||||
@@ -85,7 +82,7 @@ class PythonInstagram1977(Gimp.PlugIn):
|
|||||||
Gimp.Selection.none(img)
|
Gimp.Selection.none(img)
|
||||||
|
|
||||||
#add black border
|
#add black border
|
||||||
Bborder = Gimp.Layer.new(img,"blackBorder",w,h,RGB_MODE,100,NORMAL_MODE)
|
Bborder = Gimp.Layer.new(img,"blackBorder",w,h,Gimp.ImageType.RGBA_IMAGE,100,Gimp.LayerMode.NORMAL)
|
||||||
img.insert_layer(Bborder,lg , 0)
|
img.insert_layer(Bborder,lg , 0)
|
||||||
bcolor = Gegl.Color.new("#000000")
|
bcolor = Gegl.Color.new("#000000")
|
||||||
Gimp.context_set_foreground(bcolor)
|
Gimp.context_set_foreground(bcolor)
|
||||||
|
|||||||
Reference in New Issue
Block a user