On Friday 19 March 2004 07:36, craniac wrote:
> Przemyslaw Gawronski wrote:
> > I'm looking for tool that would give me a blur efect but with
> > a gradient intencity. That is at the begining I would have a
> > sharp pic but gradualy get more blured and more and more ...
> > (going from left to right for example).
>
> Make a copy of the layer you want to blur.  Blur the copied layer and add a
> layer mask to it.  Then fill the layer mask with a black to white gradient.

That might not have the desired effect.
It ' s a  4 liner scripfu -or python -fu that would slice the image in 
rectangular selections and run the filter variably on these rectangles what 
he is needing.

I made such a filter in python fu once, and I'd paste it here, if I had it.
I did it with the pixelize filter, all one have to do is to change the filter 
used.

It is in the script-fu list in yahoo.com archives, however. - The person taht 
was needing it did not had pythofu working, so I posted it there for someone 
to translate it into scriptfu (I have too many things to do rather than 
trying to figure Scheme out)
/me googles for "gwidion script pixelize gradient"  and clicks on first 
result.
/me pastes result here.

(I will remove the ">>" from the scripts for them to work., If you settle  for 
the python one, beware of the spacing.
 
 On Monday 17 November 2003 06:12, [EMAIL PROTECTED]
 > wrote:
 > > Here you are. Tested under gimp 1.3.22 (windows)
 > >
 > > Guillaume
 > >
 > >
 > >
 (define (script-fu-grad-pixelize img drawable
 left-ammount
right-ammount divisions)
 (define (floor x) (- x (fmod x 1))) ;there is no floor
function in script-fu !
 (let*
 (
  (width (car (gimp-image-width img)))
 (height (car (gimp-image-height img)))
  (slice-width (floor (+ (/ width divisions)
  1)))
  (slice-pixelize (/ (- right-ammount
  left-ammount)
  divisions))
 (i 0)
  ) ;end declarations
  (while (< i divisions)
  (gimp-rect-select img (floor (* i slice-width))
  0
  slice-width height 2 0 0)
  (plug-in-pixelize RUN-NONINTERACTIVE img
  drawable (+
  left-ammount (* i slice-pixelize)))
  (set! i (+ i 1))
 ) ;end while
 ) ;end let
 (gimp-displays-flush)
 ) ;end define

 (script-fu-register
 "script-fu-grad-pixelize"
 "<Image>/Script-Fu/Alchemy/Gradient
 Pixelize"
 "Horizontal Gradient Pixelizer"
 "Joao S. O. Bueno, Guilhaume"
 "(k) All rites reversed - JS"
 "2003"
 "*"
 SF-IMAGE "img" 0
  SF-DRAWABLE "drw" 0
  SF-VALUE "ammount to pixelize at left"
  "1"
  SF-VALUE "ammount to pixelize at right"
  "10"
  SF-VALUE "how many divisions on the
  image" "10"
  )
 
 > > > -----Original Message-----
 > > > From: Joao S. O. Bueno
 > [mailto:[EMAIL PROTECTED]
 > > > Sent: 16 November 2003 14:11
 > > > To: [EMAIL PROTECTED]
 > > > Subject: [script-fu] Help writting in Scheme...
 > > >
 > > >
 > > > Hi there,
 > > >
 > > > A friend of mine wanted to apply a filter (pixelize), with valuer
 > > > varying from the image left to its right.
 > > >
 > > > I quicly wrote him a python-fu script to that. But it is in
 > > > python, and he had some problem configuring gimp-python.
 > > >
 > > > I simply an not able to learn this scheme native scripting...
 > > >
 > > > :-) So, I will paste my python script here, and ask if
 > > >
 > > > someone could be kind enough to re-write it in scheme.
 > > >
 > > > Thanks in advance.
 > > >
 > > > JS
 > > > -><-
#!/usr/bin/env python

from gimpfu import *
from math import floor

def grad_pixelize (img, drawable, left_ammount,
         right_ammount,
        divisions):

        width=pdb.gimp_image_width (img)
         height=pdb.gimp_image_height (img)

         slice_width=floor(float(width)/divisions)+1


        slice_pixelize=float(right_ammount-left_ammount)/divisions

        for i in xrange (divisions):
                #change here for a call to blur.
                pdb.gimp_rect_select (img,floor 
                         (i*slice_width),
                        0,slice_width, height,
                         2,0,0)
         pdb.plug_in_pixelize (img, drawable,
         left_ammount+i*slice_pixelize)
 
register(
         "grad_pixelize",
         "Horizontal Gradient Pixelizer",
        "Horizontal Gradient Pixelizer - honest",
         "Joao S. O. Bueno",
         "(k) All rites reversed - JS",
         "2003",
         "<Image>/Python-Fu/Alchemy/Gradient Pixelize",
         "*",
         [
         (PF_INT, "left_ammount", "ammount to pixelize at left", 1),
         (PF_INT, "right_ammount",
         "ammount to pixelize at right", 10),
         (PF_INT, "divisions", "how many divisions on the image", 10),
 
         ],
         [],
         grad_pixelize)
        
main()

_______________________________________________
Gimp-user mailing list
[EMAIL PROTECTED]
http://lists.xcf.berkeley.edu/mailman/listinfo/gimp-user

Reply via email to