(define (script-fu-sharp-selection-for-pegleg44 image layer 
            border
			color
		)
	
		(let* 
			(
			(image-width 0)
			(image-height 0)
			(new-layer 0)
			(new-layer2 0)
			(brush-name 0)
			(active-vector 0)
			)


			(gimp-context-push)
			
			(set! image-width (car (gimp-image-width image)))
			(set! image-height (car (gimp-image-height image)))
			;2 create new white layer
			(set! new-layer (car (gimp-layer-new image image-width image-height
									   RGBA-IMAGE "Delete this layer" 100 NORMAL-MODE)))  ;creates layer
			(set! new-layer2 (car (gimp-layer-new image image-width image-height
									   RGBA-IMAGE "Delete this layer 2" 100 NORMAL-MODE)))  ;creates layer						   
			(gimp-image-insert-layer image new-layer 0 0)
            (gimp-image-insert-layer image new-layer2 0 0)			
			(gimp-image-set-active-layer image new-layer)
			(gimp-context-set-foreground '(255 255 255))
			(gimp-drawable-fill new-layer FOREGROUND-FILL)
			(gimp-drawable-fill new-layer2 FOREGROUND-FILL)
			
			;3 stroke path
			(gimp-context-set-defaults)
			(define brush-name (car (gimp-brush-new "1-pixel brush")))
			(gimp-context-set-brush brush-name)
			(gimp-context-set-brush-size 1)
			(gimp-context-set-paint-method "gimp-pencil")
			(gimp-context-set-foreground '(0 0 0))
			(set! active-vector (car (gimp-image-get-active-vectors image)))
			(gimp-edit-stroke-vectors new-layer active-vector)
			
			;(set! brush-name (car(gimp-brush-new "sharp selection brush")))
			;(gimp-brush-set-hardness brush-name 1)
			;(gimp-brush-set-radius brush-name 100)
			;(gimp-brush-set-aspect-ratio brush-name 1)
			;(gimp-brush-set-shape brush-name BRUSH-GENERATED-CIRCLE)
			
			;(gimp-context-set-opacity 100)
			;(gimp-context-set-brush-size 1)
			;(gimp-context-set-brush brush-name)         ;use created brush
			;(gimp-context-set-foreground '(0 0 0))
			
			
			
			;trying something else to reproduce this antialiasing stroke line instead of using brush.
			;select the path, grow it by 1 pixel then subtract the path
			;and then fill it with 
			;(gimp-image-select-item image CHANNEL-OP-REPLACE active-vector)
			;(gimp-selection-grow image 1)
			;(gimp-image-select-item image CHANNEL-OP-SUBTRACT active-vector)
			;(gimp-edit-fill new-layer FOREGROUND-FILL)
			
			;
			(gimp-selection-none image)
			(plug-in-colortoalpha 1 image new-layer '(255 255 255))
			(gimp-image-select-item image CHANNEL-OP-REPLACE new-layer)
			(gimp-selection-border image border)
			
			(gimp-image-set-active-layer image new-layer2)
			(gimp-context-set-foreground color)
			(gimp-edit-fill new-layer2 FOREGROUND-FILL)
			
			;apply curves
			(gimp-selection-none image)
			(gimp-curves-spline new-layer2 HISTOGRAM-VALUE 10 (list->vector '(0 0 
			                                                   20 96
															   68 184
															   158 240
															   255 255)))
			
			;color to alpha
			(plug-in-colortoalpha 1 image new-layer2 '(255 255 255))
			
			;make alpha to selection
			(gimp-image-select-item image CHANNEL-OP-REPLACE new-layer2)
			
			;delete worked on layer
			(gimp-image-set-active-layer image layer)
			;can't delete for some reason just set it to invisble delete our created
			(gimp-item-set-visible new-layer FALSE)
            (gimp-item-set-visible new-layer2 FALSE)			
			;(gimp-item-delete new-layer)
			
			
			
			;delete brush
			(gimp-brush-delete brush-name)
			
			(gimp-displays-flush)
			(gimp-context-pop)
	    )
	
	
    
) ;end of define

(script-fu-register
  "script-fu-sharp-selection-for-pegleg44"         ;function name
  "<Image>/Script-Fu/Sharp Selection For Pegleg44..."    ;menu register
  "Create Sharp Selection."       ;description
  "Tin Tran"                          ;author name
  "copyright info and description"         ;copyright info or description
  "2015"                          ;date
  "RGB*, GRAY*"                        ;mode
  SF-IMAGE      "Image" 0                   
  SF-DRAWABLE   "Layer" 0
  SF-ADJUSTMENT "Border Select(pixels)" '(50 0 500 1 10 0 0)
  SF-COLOR      "Foreground Color" '(0 0 0) 
  
)