All pastes #336145 Raw Edit

Something

public text v1 · immutable
·published 2007-02-01 21:00 UTC
rendered paste body
(define (script-fu-ascii img drawable dimmax)    

 (let* ( new-layer(car(gimp-text-fontname img -1 0 0 "test" 0 TRUE 20 PIXELS "aakar"))))

  (set! lx (car (gimp-image-width img)))

  (set! ly (car(gimp-image-height img)))

     (if (< lx ly)

       (if (< dimmax ly)

	    (gimp-image-scale img (/ lx (/ ly dimmax)) (/ ly (/ ly dimmax)))

           )

	(if (< dimmax lx)

	    (gimp-image-scale img (/ lx (/ lx dimmax)) (/ ly (/ lx dimmax)))

	    )

	)





(gimp-context-push)       

(gimp-image-convert-grayscale img)

(gimp-image-convert-rgb img)



(set! lx (car (gimp-image-width img)))

(set! x 1)

(while (< x lx)

       (set! pick_color (car (gimp-image-pick-color img drawable x 1 0 0 0)))

       if (= pick_color 363636 )

         (begin

           (set! new-layer(car (gimp-text-fontname img -1 0 0 (string-append " " inTitle " ") 0 TRUE 20 PIXELS "aakar")))

         ))







(set! x (+ x 1))

)

















)



(script-fu-register "script-fu-ascii"

	"<Image>/Script-Fu/Script-Perso/Ascii Art..."

	"ascii art"

	""

	""

	"2007"

	"RGB*, GRAY*"

	SF-IMAGE "Image" 0

	SF-DRAWABLE "Layer to blur" 0

	SF-ADJUSTMENT "Dim. Maxi." '( 500 100 800 1 10 0 1))